brackt/app/routes
Chris Parsons 16aa450d63
feat: proactively prune ineligible queue items after each pick (#59)
After every pick, recalculate draft eligibility for all teams and
remove any queued participants whose sport is no longer eligible
(e.g. a team queued a snooker player but just filled their last flex
slot). Previously this was only caught lazily when autodraft fired,
which could pause the draft or pick an unwanted player.

- Add getAllQueuesForSeason to draft-queue.ts — fetches all queue rows
  for a season in one query (Map<teamId, QueueItem[]>) instead of N+1
  per-team queries
- Add pruneIneligibleQueueItems to draft-utils.ts — uses Promise.all
  for the four required data fetches, collects ineligible items in a
  single loop pass, warns on orphaned participant references
- Call from both pick paths: executeAutoPick and draft.make-pick.ts
- Emit queue-eligibility-pruned socket event per affected team so the
  client updates the queue UI in real time
- Add 5 tests covering: single ineligible removal, all eligible (no-op),
  empty queues (no delete called, getTeamQueue never called), mixed
  queue (only ineligible item removed), and unknown participant (warn)

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-02 22:07:22 -08:00
..
api feat: proactively prune ineligible queue items after each pick (#59) 2026-03-02 22:07:22 -08:00
leagues feat: proactively prune ineligible queue items after each pick (#59) 2026-03-02 22:07:22 -08:00
teams feat: add random team name generation and improve league exit flow 2025-10-14 22:45:24 -07:00
admin._index.tsx feat: implement daily standings snapshot system with admin management interface 2025-11-14 09:15:58 -08:00
admin.data-sync.tsx Add Zod validation and expand export/import for EV and results data (#14) 2026-02-20 20:25:25 -08:00
admin.participants.tsx feat: add admin routes and checkbox component for sports management 2025-10-12 21:54:49 -07:00
admin.sports-seasons.$id.events.$eventId.bracket.server.ts feat: add FIFA World Cup 48-team bracket template with group stage and projected scoring 2026-02-14 22:30:12 -08:00
admin.sports-seasons.$id.events.$eventId.bracket.tsx Redesign to dark-mode-only with navy palette and accent colors (#13) 2026-02-20 19:26:11 -08:00
admin.sports-seasons.$id.events.$eventId.server.ts feat: Implement Qualifying Points Standings component and related logic 2025-11-11 10:08:25 -08:00
admin.sports-seasons.$id.events.$eventId.tsx Redesign to dark-mode-only with navy palette and accent colors (#13) 2026-02-20 19:26:11 -08:00
admin.sports-seasons.$id.events.server.ts feat: Implement Qualifying Points Standings component and related logic 2025-11-11 10:08:25 -08:00
admin.sports-seasons.$id.events.tsx Redesign to dark-mode-only with navy palette and accent colors (#13) 2026-02-20 19:26:11 -08:00
admin.sports-seasons.$id.expected-values.server.ts Refactor expected values form to batch save all participants (#4) 2026-02-19 15:57:05 -08:00
admin.sports-seasons.$id.expected-values.tsx Redesign to dark-mode-only with navy palette and accent colors (#13) 2026-02-20 19:26:11 -08:00
admin.sports-seasons.$id.futures-odds.tsx Redesign to dark-mode-only with navy palette and accent colors (#13) 2026-02-20 19:26:11 -08:00
admin.sports-seasons.$id.participants.tsx Redesign to dark-mode-only with navy palette and accent colors (#13) 2026-02-20 19:26:11 -08:00
admin.sports-seasons.$id.recalculate-probabilities.tsx Redesign to dark-mode-only with navy palette and accent colors (#13) 2026-02-20 19:26:11 -08:00
admin.sports-seasons.$id.tsx Redesign to dark-mode-only with navy palette and accent colors (#13) 2026-02-20 19:26:11 -08:00
admin.sports-seasons.new.tsx feat: Implement Qualifying Points Standings component and related logic 2025-11-11 10:08:25 -08:00
admin.sports-seasons.tsx feat: add bulk participant creation and expected value field 2025-10-15 21:21:33 -07:00
admin.sports.$id.tsx feat: add icon support for sports with file upload and active seasons display 2025-10-13 10:30:47 -07:00
admin.sports.new.tsx feat: add icon support for sports with file upload and active seasons display 2025-10-13 10:30:47 -07:00
admin.sports.tsx feat: add icon support for sports with file upload and active seasons display 2025-10-13 10:30:47 -07:00
admin.standings-snapshots.tsx Redesign to dark-mode-only with navy palette and accent colors (#13) 2026-02-20 19:26:11 -08:00
admin.templates.$id.tsx Redesign to dark-mode-only with navy palette and accent colors (#13) 2026-02-20 19:26:11 -08:00
admin.templates.new.tsx Redesign to dark-mode-only with navy palette and accent colors (#13) 2026-02-20 19:26:11 -08:00
admin.templates.tsx feat: add admin routes and checkbox component for sports management 2025-10-12 21:54:49 -07:00
admin.tsx feat: add admin routes and checkbox component for sports management 2025-10-12 21:54:49 -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 Include commissioner leagues in user's active leagues (#8) 2026-02-20 10:28:37 -08: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 feat: add invite code system for league seasons with member access control 2025-10-14 12:20:36 -07:00
rules.tsx Add rules page, rewrite how-to-play, and fix scoring display (#20) 2026-02-21 21:58:51 -08:00
test-socket.tsx fix: eliminate socket ghost connection and stale state on reconnect (#38) 2026-02-24 12:24:04 -08:00
user-profile.tsx feat: add user model, routes, and Clerk webhook integration 2025-10-11 00:53:39 -07:00