Skip to content

Latest commit

 

History

History
76 lines (54 loc) · 2.76 KB

File metadata and controls

76 lines (54 loc) · 2.76 KB

MatchPlay Updates Summary

Recent Changes

1. Round Robin Draw Generation (Backend)

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).

2. Score Entry Modal - Display Athlete Names (Frontend)

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"

3. Match Display - Sequential Numbering (Frontend)

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.

4. Game Day Leaderboard - Game-Day-Specific Stats (Backend)

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 day
  • wins: Wins from this game day only
  • losses: Losses from this game day only
  • pointsFor: Points scored in this game day
  • pointsAgainst: Points conceded in this game day
  • pointsDiff: Point differential for this game day

This ensures the Athletes tab leaderboard shows current game day performance, not season totals.

Testing

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

Documentation Updates

  • MatchPlay_Requirements.md: Updated to reflect round robin format
  • ALLOCATION_RULES.md: Updated with correct match generation formulas