brackt/app/routes/leagues
Claude efec504c08
Fix qualifying points scoring, Discord rounding, and majors count
Four related bugs in the Qualifying Points subsystem surfaced on Wimbledon:

1. Some leagues stored 2 QP instead of 1.5 for Round-of-16 losers. Sibling/
   mirror windows scored via the placement-group path in processQualifyingEvent,
   which took the tie span from the players present on that window's roster
   (a draftable subset) instead of the full field. A window holding fewer than
   the 8 tied R16 losers split the 9-16 points too few ways and over-awarded.
   The tie span is now derived from the canonical tournament_results (the whole
   field) for tournament-linked events, falling back to the live count only for
   standalone events. Every league now scores identically.

2. Discord notifications rounded QP with Math.round, turning 1.5 into "2".
   Both the "Points Awarded" and "QP Standings" values now use a 2-decimal
   formatter mirroring the web UI's formatQP, so Discord and the site agree.

3. The Discord "QP Standings" block ranked players only among that event's
   scorers, showing two R16 losers as T1 instead of T9. Rank is now computed
   over the full season field and passed through to the notifier.

4. "N of M majors completed" reached "11 of 4": majorsCompleted was a stored
   counter incremented on every fan-out sync with a guard that misfired. It is
   now derived on read (getMajorsCompleted = count of completed qualifying
   events), which is self-correcting; the increment/decrement writes are removed
   along with the now-unused hasProcessedQualifyingPlacement helper.

Adds scripts/backfill-qp-resplit.ts to silently re-score existing majors so
already-corrupted seasons are corrected (2 -> 1.5), and threads a
skipNotifications option through processQualifyingEvent / syncTournamentResults
so the backfill does not re-ping every league.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017AUcHy9m7aF6axsY6Grpe4
2026-07-03 20:40:47 +00:00
..
__tests__ Add Discord draft pick announcements (#460) 2026-05-20 19:55:48 -07:00
$leagueId.audit-log.tsx Migrate auth from Clerk to BetterAuth (#354) 2026-04-29 10:03:50 -07:00
$leagueId.draft-board.$seasonId.tsx Fix mobile spacing for draft board and dashboard layout (#13, #329) (#404) 2026-05-10 19:51:34 -07:00
$leagueId.draft-queue.$seasonId.tsx Rename queue page to Set Pre-Draft Queue, remove VORP, fix re-add race condition (#436) 2026-05-15 18:47:36 -07:00
$leagueId.draft.$seasonId.tsx Fix draft pause clock: use Math.ceil consistently via shared msToSeconds helper 2026-06-06 16:39:53 -07:00
$leagueId.server.ts Add projections to full standings; clean up change indicators 2026-06-21 11:56:15 -07:00
$leagueId.settings.server.ts Enforce unique team names within a season 2026-05-23 16:55:08 -07:00
$leagueId.settings.tsx Add Discord draft pick announcements (#460) 2026-05-20 19:55:48 -07:00
$leagueId.sports-seasons.$sportsSeasonId.events.$eventId.server.ts Show bracket on tennis Grand Slam major event pages (#113) 2026-06-28 04:35:40 +00:00
$leagueId.sports-seasons.$sportsSeasonId.events.$eventId.tsx Show bracket on tennis Grand Slam major event pages (#113) 2026-06-28 04:35:40 +00:00
$leagueId.sports-seasons.$sportsSeasonId.server.ts Fix qualifying points scoring, Discord rounding, and majors count 2026-07-03 20:40:47 +00:00
$leagueId.sports-seasons.$sportsSeasonId.tsx claude/inspiring-turing-9w84hu (#94) 2026-06-17 04:29:23 +00:00
$leagueId.standings.$seasonId.teams.$teamId.tsx Fix draft order initialization for teams added mid-season (#449) 2026-05-19 18:22:47 -07:00
$leagueId.standings.$seasonId.tsx Add projections to full standings; clean up change indicators 2026-06-21 11:56:15 -07:00
$leagueId.tsx Add projections to full standings; clean up change indicators 2026-06-21 11:56:15 -07:00
$leagueId.upcoming-events.tsx claude/beautiful-hawking-a72ilq (#92) 2026-06-16 14:11:51 +00:00
creating.tsx Extract reusable league wizard components; wire settings page (#350) 2026-04-28 22:24:13 -07:00
new.tsx claude/sports-templates-conversion-ILWAM (#71) 2026-06-04 21:31:49 +00:00