Commit graph

3 commits

Author SHA1 Message Date
Claude
a6d8162bdf
Fix 5 code review issues in F1/IndyCar standings sync
- Add unique constraint on participantSeasonResults(participantId, sportsSeasonId)
  and rewrite upsert to use onConflictDoUpdate, eliminating race conditions and
  sequential N*2 queries on sync
- Fetch pending mappings for all sport types; extend Unmatched card to show for
  individual sports and route resolve-mapping to participantSeasonResults for
  season_standings sports
- Replace hardcoded SEASON_STANDINGS_SIMULATOR_TYPES Set with
  sportsSeason.scoringPattern === "season_standings" to avoid drift
- Remove countCompletedRaces() from F1 adapter — gamesPlayed/winPct were computed
  but discarded by the orchestrator for season_standings sports
- Replace duplicate parseRacingStatsMap() with the shared statsMap() from espn.ts

https://claude.ai/code/session_012ACmUs2vAwEF9jZu7Guos2
2026-06-09 19:02:07 +00:00
Claude
9541318adf
Add F1 and IndyCar standings auto-sync
Some checks failed
🚀 Deploy / 🧪 Test (pull_request) Failing after 43s
🚀 Deploy / ʦ🔍 Typecheck & Lint (pull_request) Successful in 1m22s
🚀 Deploy / 🐳 Build (pull_request) Has been skipped
🚀 Deploy / 🚀 Deploy (pull_request) Has been skipped
Implements F1StandingsAdapter (Jolpica/Ergast API) and IndyCarStandingsAdapter
(ESPN IRL API), wires them into the syncStandings orchestrator with a
season_standings branch that upserts into participantSeasonResults instead of
regularSeasonStandings, and adds a "Championship Standings" card with a Sync
Standings button to the admin sports season page for individual sports.

https://claude.ai/code/session_012ACmUs2vAwEF9jZu7Guos2
2026-06-09 18:33:10 +00:00
Chris Parsons
bcca8b76fa
Add regular season standings for NBA/NHL (fixes #89) (#192)
Adds live standings sync and display for bracket-based sports (NBA/NHL),
so league members can see W/L tables and which teams their opponents drafted
during the regular season — not just after the playoff bracket is set.

- New `regular_season_standings` table with upsert-on-conflict sync
- Standings sync service with NHL (api-web.nhle.com) and NBA (ESPN) adapters,
  externalId write-back for future syncs, and unmatched-team resolution UI
- `RegularSeasonStandings` component: flat (NBA) + division/wild-card (NHL) modes,
  playoff line, TeamOwnerBadge, projected Brackt points (EV), mobile horizontal scroll
- Admin "Sync Standings" card + "Resolve Unmatched" UI on sports season page
- Admin manual standings edit hatch at /admin/sports-seasons/:id/regular-standings
- Show standings above bracket until matches exist; below once bracket is set
- `normalize-team-name` utility extracted to shared lib

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-21 00:12:01 -07:00