brackt/app/routes/api
Chris Parsons d468385d90
Add auto-start draft at scheduled time (#437) (#438)
Commissioners can now opt in to having a draft start automatically at
its scheduled draftDateTime rather than requiring a manual "Start Draft"
click. The 1-second timer loop checks for eligible seasons each tick and
calls the new shared startDraft() service, which is also used by the
existing commissioner HTTP route.

- Add autoStartDraft boolean to seasons table (migration 0108)
- Extract core start logic into app/services/draft-autostart.ts so both
  the API route and the timer can call it without AsyncLocalStorage
- Add checkAndAutoStartDrafts() to the timer tick; disables autoStartDraft
  and stops retrying if no draft order is set at fire time
- Guard against null draftDateTime in both the timer query (isNotNull)
  and server actions (autoStartDraft forced false when datetime is null)
- Add "Auto-start at scheduled time" checkbox to league creation wizard
  (step 3) and league settings, gated on date+time being set
- Show countdown + "Start Now" button in draft room when auto-start is
  scheduled; reuses the existing nowForPauseCheck 1-second ticker
- Show orange warning banner on league homepage to commissioners when
  auto-start is within 1 hour and no draft order has been configured

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 23:37:29 -07:00
..
__tests__ Add auto-start draft at scheduled time (#437) (#438) 2026-05-16 23:37:29 -07:00
autodraft.update.ts Migrate authentication from Clerk to BetterAuth (#324) 2026-04-24 22:00:49 -07:00
draft.adjust-time-bank.ts Migrate authentication from Clerk to BetterAuth (#324) 2026-04-24 22:00:49 -07:00
draft.force-autopick.ts Migrate authentication from Clerk to BetterAuth (#324) 2026-04-24 22:00:49 -07:00
draft.force-manual-pick.ts Show why a participant is ineligible to draft (#378) 2026-05-04 21:54:14 -07:00
draft.make-pick.ts Show why a participant is ineligible to draft (#378) 2026-05-04 21:54:14 -07:00
draft.pause.ts Migrate authentication from Clerk to BetterAuth (#324) 2026-04-24 22:00:49 -07:00
draft.replace-pick.ts Show why a participant is ineligible to draft (#378) 2026-05-04 21:54:14 -07:00
draft.resume.ts Migrate authentication from Clerk to BetterAuth (#324) 2026-04-24 22:00:49 -07:00
draft.rollback.ts Add Brackt as a league-private meta-sport (#200) (#377) 2026-05-04 20:31:44 -07:00
draft.start.ts Add auto-start draft at scheduled time (#437) (#438) 2026-05-16 23:37:29 -07:00
queue.add.ts Migrate authentication from Clerk to BetterAuth (#324) 2026-04-24 22:00:49 -07:00
queue.clear.ts Migrate authentication from Clerk to BetterAuth (#324) 2026-04-24 22:00:49 -07:00
queue.remove.ts Migrate authentication from Clerk to BetterAuth (#324) 2026-04-24 22:00:49 -07:00
queue.reorder.ts Migrate authentication from Clerk to BetterAuth (#324) 2026-04-24 22:00:49 -07:00
seasons.$seasonId.draft.ts Canonical tournament layer: schema + backfill (1/2) (#365) 2026-05-01 20:13:18 -07:00
user.timezone.ts Add overnight pause for draft timers (#335) 2026-04-26 22:31:52 -07:00
watchlist.toggle.ts Mobile draft room improvements: watchlist, collapsible picks feed, autodraft controls (#355) 2026-04-29 11:49:26 -07:00