Enforce standalone workshop signup capacity on participant join paths - #173
Merged
Conversation
Co-authored-by: qin-guan <10321883+qin-guan@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
qin-guan
August 27, 2026 06:27
View session
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
portal | db60097 | Commit Preview URL Branch Preview URL |
Aug 27 2026, 05:47 AM |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
portal-oidc-web-playground | db60097 | Commit Preview URL Branch Preview URL |
Aug 27 2026, 05:49 AM |
qin-guan
marked this pull request as ready for review
August 27, 2026 06:29
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds standalone workshop capacity enforcement to the participant “join” endpoints, aligning seat counting with existing analytics semantics (active registrations only) and adding integration coverage for the “workshop full” behavior.
Changes:
- Added capacity checks to both standalone workshop participant join flows (ID-based and short-code based).
- Capacity is computed from active registrations only (
Status == Registered && WithdrawnAt == null) to match analytics. - Added integration tests ensuring a second distinct user receives
400 BadRequestwhen capacity is exhausted.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| GeeksHackingPortal.Api/Endpoints/Participants/StandaloneWorkshops/Join/Endpoint.cs | Adds capacity guard to the standard participant join route. |
| GeeksHackingPortal.Api/Endpoints/Participants/StandaloneWorkshops/JoinByShortCode/Endpoint.cs | Adds the same capacity guard to the short-code join route. |
| GeeksHackingPortal.Tests/Endpoints/Participants/StandaloneWorkshops/StandaloneWorkshopJoinAndStatusTests.cs | Adds integration tests asserting 400 when a second user attempts to join a full workshop via both join paths. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+47
to
+54
| var registeredCount = await sql.Queryable<ActivityRegistration>() | ||
| .CountAsync( | ||
| r => | ||
| r.ActivityId == workshop.Id | ||
| && r.Status == ActivityRegistrationStatus.Registered | ||
| && r.WithdrawnAt == null, | ||
| ct | ||
| ); |
Comment on lines
+48
to
+55
| var registeredCount = await sql.Queryable<ActivityRegistration>() | ||
| .CountAsync( | ||
| r => | ||
| r.ActivityId == workshop.Id | ||
| && r.Status == ActivityRegistrationStatus.Registered | ||
| && r.WithdrawnAt == null, | ||
| ct | ||
| ); |
Comment on lines
+55
to
+57
| [Test] | ||
| public async Task JoinStandaloneWorkshop_WhenWorkshopIsFull_ReturnsBadRequest() | ||
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Standalone workshop signup limits were not enforced for participant registration, allowing over-capacity joins. This change adds capacity checks to both participant join flows so registration is rejected once active seats are exhausted.
Capacity enforcement in join endpoints
MaxParticipantsguard to:POST /participants/standalone-workshops/{StandaloneWorkshopId}/joinPOST /participants/standalone-workshops/join(short code path)Status == Registered && WithdrawnAt == null), matching existing analytics semantics.Behavioral coverage for full workshops
400when workshop capacity is already full.