brackt/app/routes
Chris Parsons fa0e798db7
Add "Games to Score" widget to admin dashboard (#183)
* Add "Games to Score" widget to admin dashboard

Shows scoring events for today and tomorrow in a tabbed card, with
status badges (Pending/Scored), a scored/total progress counter, and
direct "Score" / "View" links to each event's results page. Excludes
non-scoring schedule_event types so only actionable events surface.

- app/models/scoring-event.ts: add getEventsForDates() model function
  that queries scoringEvents joined with sportsSeasons/sport for a
  given list of date strings
- app/routes/admin._index.tsx: call getEventsForDates([today, tomorrow])
  in the loader and render the GamesToScore component below the stats row
- app/models/__tests__/scoring-event-dashboard.test.ts: 8 unit tests
  covering empty input, shape mapping, multi-date filtering, completed
  events, and the inArray where conditions

https://claude.ai/code/session_014zKK15o5RJfTaodLvnZpF5

* Fix getEventsForDates to include bracket events by game scheduledAt

The previous implementation only matched on scoringEvents.eventDate,
which is often null for bracket events where individual game times are
set on playoffMatchGames.scheduledAt instead.

Switched to a two-step query mirroring getUpcomingEventsForDraftedParticipants:
1. selectDistinct event IDs via left joins through playoffMatches →
   playoffMatchGames, matching where eventDate IN dates OR any game's
   scheduledAt falls within the date range's timestamp bounds
2. findMany on the matched IDs with sportsSeason + sport relations

Updated tests to cover the two-step flow, leftJoin usage, and the
scheduledAt timestamp bounds appearing in the where clause.

https://claude.ai/code/session_014zKK15o5RJfTaodLvnZpF5

* Document dual game date storage in CLAUDE.md

scoringEvents.eventDate and playoffMatchGames.scheduledAt both hold game
dates depending on the event type. Added a dedicated section under
Important Patterns explaining when each is used and the two-step
selectDistinct + findMany pattern required for correct date queries.

https://claude.ai/code/session_014zKK15o5RJfTaodLvnZpF5

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-03-19 19:25:37 -07:00
..
api Optimize user data fetching with batch queries and centralize display name logic (#176) 2026-03-18 16:46:07 -07:00
leagues Refactor standings notifications to show only changed teams (#182) 2026-03-19 15:52:57 -07:00
teams feat: add meta title to all route pages (#109) 2026-03-10 12:10:52 -07:00
admin._index.tsx Add "Games to Score" widget to admin dashboard (#183) 2026-03-19 19:25:37 -07:00
admin.data-sync.tsx feat: add meta title to all route pages (#109) 2026-03-10 12:10:52 -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.events.$eventId.bracket.server.ts Fix standings snapshot upsert: atomic writes, correct date, and event-driven updates (#177) 2026-03-18 22:15:28 -07:00
admin.sports-seasons.$id.events.$eventId.bracket.tsx Fix partial bracket scoring, rank labels, and Discord notification bugs (#158) 2026-03-17 12:34:10 -07:00
admin.sports-seasons.$id.events.$eventId.server.ts Add event_starts_at timestamp to scoring events for sub-day ordering (#146) 2026-03-15 10:22:42 -07:00
admin.sports-seasons.$id.events.$eventId.tsx Fix event date timezone bugs (UTC rollover + same-day status) (#148) 2026-03-15 12:28:39 -07:00
admin.sports-seasons.$id.events.server.ts Add event_starts_at timestamp to scoring events for sub-day ordering (#146) 2026-03-15 10:22:42 -07:00
admin.sports-seasons.$id.events.tsx Fix event date timezone bugs (UTC rollover + same-day status) (#148) 2026-03-15 12:28:39 -07:00
admin.sports-seasons.$id.expected-values.server.ts Add NCAAM and NCAAW bracket Monte Carlo simulators (#150) 2026-03-15 23:31:47 -07:00
admin.sports-seasons.$id.expected-values.tsx Add NCAAM and NCAAW bracket Monte Carlo simulators (#150) 2026-03-15 23:31:47 -07:00
admin.sports-seasons.$id.futures-odds.tsx feat: add meta title to all route pages (#109) 2026-03-10 12:10:52 -07:00
admin.sports-seasons.$id.participants.tsx feat: add meta title to all route pages (#109) 2026-03-10 12:10:52 -07:00
admin.sports-seasons.$id.simulate.tsx Add NCAAM and NCAAW bracket Monte Carlo simulators (#150) 2026-03-15 23:31:47 -07:00
admin.sports-seasons.$id.standings.tsx feat: add meta title to all route pages (#109) 2026-03-10 12:10:52 -07:00
admin.sports-seasons.$id.tsx Add isDraftable toggle to sport seasons (#165) (#178) 2026-03-18 22:40:19 -07:00
admin.sports-seasons.new.tsx feat: add meta title to all route pages (#109) 2026-03-10 12:10:52 -07:00
admin.sports-seasons.tsx Add isDraftable toggle to sport seasons (#165) (#178) 2026-03-18 22:40:19 -07:00
admin.sports.$id.tsx Add NHL playoff simulator and fix simulator dropdown (#166) 2026-03-18 01:23:53 -07:00
admin.sports.new.tsx feat: add meta title to all route pages (#109) 2026-03-10 12:10:52 -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 feat: add meta title to all route pages (#109) 2026-03-10 12:10:52 -07:00
admin.templates.$id.tsx feat: add meta title to all route pages (#109) 2026-03-10 12:10:52 -07:00
admin.templates.new.tsx feat: add meta title to all route pages (#109) 2026-03-10 12:10:52 -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 event_starts_at timestamp to scoring events for sub-day ordering (#146) 2026-03-15 10:22:42 -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
test-socket.tsx feat: add meta title to all route pages (#109) 2026-03-10 12:10:52 -07:00
user-profile.tsx feat: add meta title to all route pages (#109) 2026-03-10 12:10:52 -07:00