File: matchplay/backend/routes/gamedays.js
Updated the generateGroupMatches() function to create full round robin matches:
-
4-player groups: Now generates 3 matches (full round robin)
- Match 1: A+B vs C+D
- Match 2: A+C vs B+D
- Match 3: A+D vs B+C
- Each player partners with every other player once
-
5-player groups: Now generates 5 matches (full round robin with rotating bye)
- Match 1: A+B vs C+D (E bye)
- Match 2: A+C vs D+E (B bye)
- Match 3: A+D vs B+E (C bye)
- Match 4: A+E vs B+C (D bye)
- Match 5: B+D vs C+E (A bye)
- Each player partners with every other player once and sits out once
Updated the preview endpoint to show correct match counts (3 for 4-player, 5 for 5-player).
File: matchplay/frontend/src/components/gameday/MatchesTab.jsx
Changed the score entry modal labels from generic "Team A Score" and "Team B Score" to display actual athlete names:
- Before: "Team A Score"
- After: "John Smith & Jane Doe"
File: matchplay/frontend/src/components/gameday/MatchesTab.jsx
Updated match cards to show sequential match numbers instead of just the match ID:
- Before: "Match 90e5ae60"
- After: "Match 1 (90e5ae60)"
The match ID is kept in brackets in gray for reference.
File: matchplay/backend/routes/gamedays.js
Modified the GET /api/gamedays/:id/athletes endpoint to calculate and return game-day-specific statistics instead of overall season stats:
Stats now calculated from:
- Only matches played in the current game day
- Only completed matches (where scores have been entered)
- Excludes matches where the athlete has a bye
Stats returned:
matchesPlayed: Number of matches played in this game daywins: Wins from this game day onlylosses: Losses from this game day onlypointsFor: Points scored in this game daypointsAgainst: Points conceded in this game daypointsDiff: Point differential for this game day
This ensures the Athletes tab leaderboard shows current game day performance, not season totals.
A test script was created at matchplay/backend/test-draw.js to verify the round robin logic:
- Validates 4-player round robin (3 matches)
- Validates 5-player round robin (5 matches)
- Verifies each player partners with everyone exactly once
- Verifies bye rotation in 5-player groups
Test results: ✓ All tests passing
MatchPlay_Requirements.md: Updated to reflect round robin formatALLOCATION_RULES.md: Updated with correct match generation formulas