elimination announcements #114

Merged
chrisp merged 2 commits from claude/elimination-announcements-g88ixv into main 2026-06-28 19:36:34 +00:00

2 commits

Author SHA1 Message Date
Claude
f75f3a228e
Address code review on elimination announcements
All checks were successful
🚀 Deploy / 🧪 Test (pull_request) Successful in 2m49s
🚀 Deploy / ʦ🔍 Typecheck & Lint (pull_request) Successful in 1m18s
🚀 Deploy / 🐳 Build (pull_request) Has been skipped
🚀 Deploy / 🚀 Deploy (pull_request) Has been skipped
- Extract markEliminatedAndAnnounce helper, removing the duplicated
  load-existing-results / collect-newly-eliminated / gated-recalc pattern
  from the generate-bracket, generate-groups, and populate-knockout intents.
- Wrap the Discord announcement in a log-only try/catch so a failed
  standings recalc/snapshot never fails the (already-committed) bracket
  generation action.
- Drop eventId from the elimination recalc call so announcements don't pull
  in unrelated completed matches as Scored Matches.
- Hoist the per-season draftPicks lookup in recalculateAffectedLeagues so the
  scored-match and elimination sections share one query.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E5gLy3K9vW65ogG8GTCjWE
2026-06-28 18:43:28 +00:00
Claude
c7dcbb0682
Announce playoff eliminations to Discord on bracket generation
Teams that miss the playoffs (NBA-style brackets) or are knocked out in the
group stage (FIFA group->knockout) were correctly marked eliminated but never
announced to league Discord channels — the elimination intents never called
recalculateAffectedLeagues, and these 0-pt eliminations have no score delta or
match to surface in the existing scored-match/standings sections.

Add an 'Eliminated' section to the standings-update embed and feed newly
eliminated drafted participants through recalculateAffectedLeagues via a new
eliminatedParticipantIds option. Wire it into generate-bracket, generate-groups,
and populate-knockout, gated to fantasy events only (qualifying-point majors like
tennis/CS2 are excluded) and scoped to participants newly eliminated by the run.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E5gLy3K9vW65ogG8GTCjWE
2026-06-28 17:37:34 +00:00