brackt/app/routes
Chris Parsons f356bdce03
Fix NBA Play-In Round 1 loser advancement logic (#296)
* Fix NBA Play-In 7/8 loser incorrectly marked as eliminated

processPlayoffEvent (called by autoCompleteRoundIfDone when all round matches
finish) was marking every non-scoring round loser as eliminated without
checking doesLoserAdvance. This caused the 7v8 loser, who should advance to
Play-In Round 2, to get finalPosition=0 as soon as the full round completed.

Fixes:
- processPlayoffEvent now calls doesLoserAdvance per match before writing a
  0-pt elimination result, matching the guard already in processMatchResult
- recalculate-floors handler now passes loserAdvances to processMatchResult
  so a full reprocess also respects the loser-advances rule
- recalculateAffectedLeagues gains a skipDiscord option; recalculate-floors
  uses it so clicking the admin "Recalculate Floors" button corrects the bad
  data without re-announcing results on Discord
- Add two tests confirming 7v8 loser is not eliminated and 9v10 loser is

https://claude.ai/code/session_01QmvezscLYY38gN4GbvXZbA

* Address code review feedback on Play-In loserAdvances fix

- Use outer `round` variable instead of match.round in processPlayoffEvent
  (they're identical, but consistent with surrounding code)
- Add comment at recalculate-floors call site explaining skipDiscord intent
- Combine two redundant test cases into one covering all four assertions
- Add West conference matches (M3/M4) to test fixture — East-only was
  insufficient given doesLoserAdvance checks matchNumber 1 & 3
- Add guard test: when bracketTemplateId is null all losers are eliminated,
  catching any future refactor that drops the field from the DB query

https://claude.ai/code/session_01QmvezscLYY38gN4GbvXZbA

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-04-15 09:40:53 -07:00
..
__tests__ feat: batch qualifying results entry (#290) 2026-04-12 14:52:22 -07:00
admin/__tests__ fix: infer LLWS bracket side from name when externalId is null (#285) 2026-04-09 09:51:16 -04:00
api Add audit logging for commissioner actions (#293) 2026-04-13 15:45:39 -07:00
leagues fix: league settings sports swap and audit log detail improvements (#294) 2026-04-14 21:41:05 -07:00
teams feat: add meta title to all route pages (#109) 2026-03-10 12:10:52 -07:00
admin._index.tsx Improve admin dashboard stats and fix scoring event bugs (#230) 2026-03-25 20:46:54 -07:00
admin.data-sync.tsx Replace console.* with structured logger, fix no-inferrable-types (closes #98) (#199) 2026-03-21 13:41:39 -07:00
admin.participants.tsx feat: add meta title to all route pages (#109) 2026-03-10 12:10:52 -07:00
admin.sports-seasons.$id.clone.tsx feat: clone sports season (#282) (#288) 2026-04-11 22:03:37 -07:00
admin.sports-seasons.$id.elo-ratings.tsx Add CS2 Major Qualifying Points simulator and stage management (#260) 2026-04-05 16:40:05 -04:00
admin.sports-seasons.$id.events.$eventId.bracket.server.ts Fix NBA Play-In Round 1 loser advancement logic (#296) 2026-04-15 09:40:53 -07:00
admin.sports-seasons.$id.events.$eventId.bracket.tsx fix: NBA play-in bracket advancement bugs (#292) 2026-04-12 22:25:32 -07:00
admin.sports-seasons.$id.events.$eventId.cs2-setup.tsx Add CS2 Major Qualifying Points simulator and stage management (#260) 2026-04-05 16:40:05 -04:00
admin.sports-seasons.$id.events.$eventId.helpers.ts feat: batch qualifying results entry (#290) 2026-04-12 14:52:22 -07:00
admin.sports-seasons.$id.events.$eventId.server.ts feat: batch qualifying results entry (#290) 2026-04-12 14:52:22 -07:00
admin.sports-seasons.$id.events.$eventId.tsx feat: batch qualifying results entry (#290) 2026-04-12 14:52:22 -07:00
admin.sports-seasons.$id.events.server.ts Replace console.* with structured logger, fix no-inferrable-types (closes #98) (#199) 2026-03-21 13:41:39 -07:00
admin.sports-seasons.$id.events.tsx Fix oxlint warnings: no-shadow, consistent-function-scoping, no-non-null-assertion, and others (#196) 2026-03-21 10:59:51 -07:00
admin.sports-seasons.$id.expected-values.server.ts fix: address VORP code review issues (#283) 2026-04-08 23:20:02 -04:00
admin.sports-seasons.$id.expected-values.tsx Fix oxlint warnings: no-shadow, consistent-function-scoping, no-non-null-assertion, and others (#196) 2026-03-21 10:59:51 -07:00
admin.sports-seasons.$id.futures-odds.tsx Replace console.* with structured logger, fix no-inferrable-types (closes #98) (#199) 2026-03-21 13:41:39 -07:00
admin.sports-seasons.$id.golf-skills.tsx Prevent duplicate participants within a sports season, fixes #69 (#236) 2026-03-27 01:09:04 -07:00
admin.sports-seasons.$id.participants.tsx fix: infer LLWS bracket side from name when externalId is null (#285) 2026-04-09 09:51:16 -04:00
admin.sports-seasons.$id.regular-standings.tsx Replace console.* with structured logger, fix no-inferrable-types (closes #98) (#199) 2026-03-21 13:41:39 -07:00
admin.sports-seasons.$id.simulate.tsx Add FIFA World Cup 2026 support with group stage display and Monte Carlo simulator (#242) 2026-03-29 10:27:47 -07:00
admin.sports-seasons.$id.standings.tsx Replace console.* with structured logger, fix no-inferrable-types (closes #98) (#199) 2026-03-21 13:41:39 -07:00
admin.sports-seasons.$id.surface-elo.tsx Prevent duplicate participants within a sports season, fixes #69 (#236) 2026-03-27 01:09:04 -07:00
admin.sports-seasons.$id.tsx feat: clone sports season (#282) (#288) 2026-04-11 22:03:37 -07:00
admin.sports-seasons.new.tsx Replace isDraftable boolean with draftOn/draftOff date range (#263) 2026-04-05 22:09:52 -04:00
admin.sports-seasons.tsx feat: sort admin sports seasons by status, sport name, then year (#286) 2026-04-09 10:07:18 -04:00
admin.sports.$id.tsx Add golf qualifying points simulator (Plackett-Luce Monte Carlo) (#223) 2026-03-24 21:46:02 -07:00
admin.sports.new.tsx Replace console.* with structured logger, fix no-inferrable-types (closes #98) (#199) 2026-03-21 13:41:39 -07:00
admin.sports.tsx feat: add meta title to all route pages (#109) 2026-03-10 12:10:52 -07:00
admin.standings-snapshots.tsx Replace console.* with structured logger, fix no-inferrable-types (closes #98) (#199) 2026-03-21 13:41:39 -07:00
admin.templates.$id.tsx Replace console.* with structured logger, fix no-inferrable-types (closes #98) (#199) 2026-03-21 13:41:39 -07:00
admin.templates.new.tsx Replace console.* with structured logger, fix no-inferrable-types (closes #98) (#199) 2026-03-21 13:41:39 -07:00
admin.templates.tsx feat: add meta title to all route pages (#109) 2026-03-10 12:10:52 -07:00
admin.tsx feat: add meta title to all route pages (#109) 2026-03-10 12:10:52 -07:00
api.admin.export-sports-data.ts feat: add admin routes and checkbox component for sports management 2025-10-12 21:54:49 -07:00
home.tsx Add upcoming events pages and fix timezone filtering, fixes #213 (#235) 2026-03-27 00:49:16 -07:00
how-to-play.tsx Add rules page, rewrite how-to-play, and fix scoring display (#20) 2026-02-21 21:58:51 -08:00
i.$inviteCode.tsx Optimize user data fetching with batch queries and centralize display name logic (#176) 2026-03-18 16:46:07 -07:00
rules.tsx Add rules page, rewrite how-to-play, and fix scoring display (#20) 2026-02-21 21:58:51 -08:00
support.tsx Add support page with Discord link and contact form, fixes #233 (#234) 2026-03-26 17:17:49 -07:00
test-socket.tsx Replace console.* with structured logger, fix no-inferrable-types (closes #98) (#199) 2026-03-21 13:41:39 -07:00
upcoming-events.tsx Add upcoming events pages and fix timezone filtering, fixes #213 (#235) 2026-03-27 00:49:16 -07:00
user-profile.tsx feat: add meta title to all route pages (#109) 2026-03-10 12:10:52 -07:00