brackt/app/services/match-sync/__tests__
Claude 999f70c4eb
feat: add match sync service, cron job, public tournament display (Phases 2-4)
Phase 2 — Match Sync Adapters + Cron Job:
- PandaScoreMatchSyncAdapter (CS2): fetches matches with map-level sub-games, stage detection
- EspnScheduleAdapter (MLB/NBA/MLS/WNBA/NHL): fetches scoreboard with live scores
- syncMatches() orchestrator: resolves participants by externalId+name, bulk-upserts season_matches, syncs playoff bracket results through existing setMatchWinner/processMatchResult pipeline
- POST /admin/jobs/sync-matches cron endpoint (mirrors sync-and-simulate pattern)
- External Season ID field added to sports season create/edit admin forms
- Sync from API button wired in CS2 setup page (enabled when externalSeasonId set)

Phase 3 — Public Tournament & Schedule Display:
- MatchSchedule component: generic match list with live/scheduled/complete status badges, matchday grouping
- Cs2TournamentBracket component: tab layout (Opening/Challengers/Legends/Champions Stage), map scores per match
- /sports-seasons/:sportsSeasonId/tournament public route with 30-second live polling

Phase 4 — Playoff Bracket Auto-Sync:
- externalMatchId column added to playoff_matches table (migration 0121)
- Bracket matches (matchStage=null) auto-synced: matches existing playoff_match rows by externalMatchId then participant IDs, calls full scoring pipeline
- autoCompleteRoundIfDone extracted to scoring-calculator.ts for shared use

All 2365 tests pass; typecheck clean.

https://claude.ai/code/session_01WUUM7uWzFoSkGcZRhnEKG6
2026-06-12 20:46:30 +00:00
..
espn-schedule.test.ts feat: add match sync service, cron job, public tournament display (Phases 2-4) 2026-06-12 20:46:30 +00:00
pandascore.test.ts feat: add match sync service, cron job, public tournament display (Phases 2-4) 2026-06-12 20:46:30 +00:00