brackt/app/lib
Chris Parsons 338979e0a8
Add FIFA World Cup 2026 support with group stage display and Monte Carlo simulator (#242)
* Add FIFA World Cup 2026 support with group stage display and Monte Carlo simulator, fixes #127

- New `groupStageMatches` table for recording group play results (W/D/L, scores, matchday, schedule)
- `computeGroupStandings()` model function: pts → GD → GF → name tiebreaker ordering
- `GroupStageStandings` component showing all 12 groups with standings table and manager column
- Admin bracket UI: group match score entry, per-group standings, "Recalculate Floors" action
- `WorldCupSimulator`: 50k Monte Carlo covering group stage + best-8 3rd-place + knockout + 3rd place game
  - Fuzzy name matching for national team Elo lookup (exact → substring → word-overlap), warns on miss
  - Partial group completion: completed matches replayed with real scores, remaining matches simulated
  - Elo priority: admin-entered sourceElo > futures odds converted to Elo > hardcoded national team ratings
- `fifa_48` bracket template: added Third Place Game round with `loserFeedsInto` on Semifinals
- Scoring rules: distinct 3rd/4th place for `fifa_48` (not averaged), QF losers share 5th–8th equally
- Floor scoring: SF participants guaranteed 4th (provisional), finalized after 3rd place game
- `recalculate-floors` admin action deletes and replays all results from scratch (fixes stale guard bug)
- Unique index on `(tournamentGroupId, participant1Id, participant2Id)` to prevent duplicate pairings
- Batch `findMatchesByGroupIds()` replacing N sequential queries in the sport season loader
- League home mini-standings now shows `actualPoints` (includes floor) instead of `totalPoints` only
- Elo ratings admin page supports World Cup (same bulk-import flow as snooker)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* Fix TypeScript errors: update GroupStandingData type to use findMatchesByGroupIds

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* Increase Node heap to 4GB for unit tests in CI to prevent OOM

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* Fix OOM in CI: make WorldCupSimulator simulation count configurable for tests

Tests now pass numSimulations=500 instead of the production default of 50,000.
Six simulator tests × 50k iterations each was exhausting the 4GB heap on GitHub
Actions runners. Also reduce simGroupMatch stat tests from 50k to 5k iterations.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-29 10:27:47 -07:00
..
__tests__ Show tied ranks with T prefix across standings and Discord (#239) 2026-03-27 20:45:15 -07:00
bracket-templates.ts Add FIFA World Cup 2026 support with group stage display and Monte Carlo simulator (#242) 2026-03-29 10:27:47 -07:00
color-hash.ts User/chris/bracket UI redesign (#95) 2026-03-09 22:44:33 -07:00
date-utils.ts Consolidate F1/IndyCar simulators into shared AutoRacingSimulator class (#151) 2026-03-16 12:22:08 -07:00
draft-eligibility.ts Implement Omni League Draft Eligibility Rules 2025-10-24 21:12:07 -07:00
draft-order.ts Add browser push notifications toggle to draft page (#11) 2026-02-20 19:30:53 -08:00
draft-timer.ts Add standard draft clock mode (#67) (#189) 2026-03-20 21:36:39 -07:00
fuzzy-match.ts Add golf qualifying points simulator (Plackett-Luce Monte Carlo) (#223) 2026-03-24 21:46:02 -07:00
logger.ts Replace console.* with structured logger, fix no-inferrable-types (closes #98) (#199) 2026-03-21 13:41:39 -07:00
normalize-team-name.ts Add regular season standings for NBA/NHL (fixes #89) (#192) 2026-03-21 00:12:01 -07:00
owner-map.ts Add oxlint linting setup with zero errors (#194) 2026-03-21 09:44:05 -07:00
scoring-types.ts feat: Add scoring rules editor to league settings and creation pages 2025-10-29 00:04:27 -07:00
season-helpers.server.ts Add oxlint linting setup with zero errors (#194) 2026-03-21 09:44:05 -07:00
standings-display.ts Show tied ranks with T prefix across standings and Discord (#239) 2026-03-27 20:45:15 -07:00
utils.ts feat: add theme system with dark mode support and navbar component 2025-10-10 23:30:26 -07:00