What this is: The entry point for the knockout tournament system. No match engine logic — purely the data layer and the admin creation UI.
Starts after: Stage 4 complete.
Owner: Full-stack developer comfortable with multi-step forms and Mongoose.
Tasks
-
Verify tournament schemas against real usage (schemas were created in Stage 1; this stage validates them with actual documents)
- Create test
Contest documents with format: 'bracket', roomFormat: 'blitz' and roomFormat: 'arena'.
- Verify
ContestRound and ContestStanding work correctly for bracket structure.
- Verify
ContestRoom tournament context fields (nullable roundId, bracket position) do not affect standalone room queries. Run Stage 3 + 4 tests to confirm.
-
Tournament Creation Wizard (/internal/contests/admin/new-contest)
- Multi-step form:
- Step 1: name, description. Format is fixed:
bracket. Room format: blitz or arena. Team size: 1 (1v1) or 3 (3v3).
- Step 2: registration settings (open/closed, deadline, max participants).
- Step 3: match preset selection.
- Step 4: bracket settings (third-place playoff toggle, seeding method: CF rating or manual).
- Step 5: preview & confirm.
- Server-side validation on every step.
- On submission: create
Contest document with format: 'bracket', status: 'draft', roomFormat, teamSize.
-
Registration flow
POST /api/contests/:id/register — player or team registers.
- Validates deadline, max participants.
- Triggers
solved:<cfHandle> prefetch BullMQ job for all registering members.
- Appends to
Contest.registrations.
-
Preset management (/internal/contests/admin/presets)
- CRUD for
ContestPreset. Archive (not delete). Archived presets are not shown in the creation wizard but are preserved in DB for historical reference.
-
Contest status transitions
draft → registration (admin publishes).
registration → active (admin starts or scheduled auto-start).
active → completed (all bracket rounds done).
Testing Gate
Handoff Contract
What this is: The entry point for the knockout tournament system. No match engine logic — purely the data layer and the admin creation UI.
Starts after: Stage 4 complete.
Owner: Full-stack developer comfortable with multi-step forms and Mongoose.
Tasks
Verify tournament schemas against real usage (schemas were created in Stage 1; this stage validates them with actual documents)
Contestdocuments withformat: 'bracket',roomFormat: 'blitz'androomFormat: 'arena'.ContestRoundandContestStandingwork correctly for bracket structure.ContestRoomtournament context fields (nullableroundId, bracket position) do not affect standalone room queries. Run Stage 3 + 4 tests to confirm.Tournament Creation Wizard (
/internal/contests/admin/new-contest)bracket. Room format:blitzorarena. Team size: 1 (1v1) or 3 (3v3).Contestdocument withformat: 'bracket',status: 'draft',roomFormat,teamSize.Registration flow
POST /api/contests/:id/register— player or team registers.solved:<cfHandle>prefetch BullMQ job for all registering members.Contest.registrations.Preset management (
/internal/contests/admin/presets)ContestPreset. Archive (not delete). Archived presets are not shown in the creation wizard but are preserved in DB for historical reference.Contest status transitions
draft → registration(admin publishes).registration → active(admin starts or scheduled auto-start).active → completed(all bracket rounds done).Testing Gate
Contestdocument in MongoDB has the correct shape:format: 'bracket',roomFormat: 'blitz',registrations: [],status: 'draft'.roomFormat: 'arena'.Contest.registrationsupdated.solved:*keys populated for all 4 CF handles.Handoff Contract
Contestdocuments for knockout format exist in the dev DB as test fixtures.