brackt/app/lib/event-utils.ts
Claude 40fc541329
Some checks failed
🚀 Deploy / 🧪 Test (pull_request) Successful in 2m46s
🚀 Deploy / ʦ🔍 Typecheck & Lint (pull_request) Failing after 1m10s
🚀 Deploy / 🐳 Build (pull_request) Has been skipped
🚀 Deploy / 🚀 Deploy (pull_request) Has been skipped
Fix code review findings for major_tournament bracket support
- Add isBracketMajor() helper (event-utils.ts) as single source of truth
  for distinguishing CS2/Tennis bracket events from golf manual-entry events
- Replace all playoff_game-only guards in the admin event detail page with
  isBracketEvent, fixing: manual result forms, current results card, bracket
  explanation card, Bracket Finalized badge, and styling
- Extend delete handler in scoring-event.ts to clean up seasonParticipantResults
  and recalculate standings when a major_tournament event is deleted
- Add simulatorType to UpcomingParticipantEvent; thread it from home/upcoming-events
  loaders; fix isAllCompete in SportSeasonCard, UpcomingEventsCard, UpcomingCalendarPanel
  so CS2/Tennis bracket events show individual participant badges instead of counts

https://claude.ai/code/session_01SFmJQxQZsKxvJ5rhbYk3za
2026-06-15 21:25:09 +00:00

12 lines
477 B
TypeScript

const BRACKET_MAJOR_SIMULATOR_TYPES = [
"cs2_major_qualifying_points",
"tennis_qualifying_points",
] as const;
/**
* Returns true for major_tournament events that use a bracket (CS2, Tennis).
* Golf (golf_qualifying_points) uses manual result entry and returns false.
*/
export function isBracketMajor(simulatorType: string | null | undefined): boolean {
return BRACKET_MAJOR_SIMULATOR_TYPES.includes(simulatorType as typeof BRACKET_MAJOR_SIMULATOR_TYPES[number]);
}