claude/discord-qualifying-points-t55s3x #121

Merged
chrisp merged 3 commits from claude/discord-qualifying-points-t55s3x into main 2026-07-01 17:29:46 +00:00
Owner
No description provided.
chrisp added 2 commits 2026-07-01 16:37:50 +00:00
Fire a gold-colored Discord embed whenever QP is awarded during a season
(tennis/golf majors via processQualifyingEvent, CS2 Swiss stages via
assignCs2EliminationQP) so league members see progress throughout the
season rather than only when QP finalize into fantasy placements.

- discord.ts: QPEventEntry interface + sendQualifyingPointsUpdateNotification
  (gold embed with Points Awarded, No Points, and QP Standings sections)
- qualifying-points-discord.server.ts: notifyQualifyingPointsUpdate — looks
  up affected leagues, maps drafted participants to teams/owners, assembles
  entries, and fires the notification per league webhook
- scoring-calculator.ts: call notifyQualifyingPointsUpdate at end of
  processQualifyingEvent (covers tennis, golf, CS2 Champions bracket)
- cs2-major-stage.ts: call notifyQualifyingPointsUpdate at end of
  assignCs2EliminationQP (covers all CS2 Swiss stages incl. 0-QP exits)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NnJP1NTYXHxL2kbE4fZaD6
Fix code review findings for QP Discord notifications
Some checks failed
🚀 Deploy / 🧪 Test (pull_request) Successful in 2m57s
🚀 Deploy / ʦ🔍 Typecheck & Lint (pull_request) Failing after 47s
🚀 Deploy / 🐳 Build (pull_request) Has been skipped
🚀 Deploy / 🚀 Deploy (pull_request) Has been skipped
aea71a5ad6
- Round qpEarned and qpTotal with Math.round() so fractional tie-split
  values display as integers ("+2 QP" not "+1.5 QP")
- Swap embed colors: standings → gold (0xffd700), QP → blurple (0x5865f2)
- Add logger.error in cs2-major-stage.ts to match scoring-calculator.ts
  error handling pattern (replaces silent .catch(() => {}))
- Fix cumulative CS2 re-announcement: snapshot existing QP before writing
  and only notify participants whose QP is new or changed in this call;
  add participantIdFilter parameter to notifyQualifyingPointsUpdate
- Batch all pre-loop queries in notifyQualifyingPointsUpdate (seasons,
  draftPicks, participantNames, users, Discord IDs) to eliminate N+1
  queries across league iterations
- Add unit tests for notifyQualifyingPointsUpdate covering early-return
  paths, per-league filtering, Discord ID resolution, and participantIdFilter

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NnJP1NTYXHxL2kbE4fZaD6
chrisp added 1 commit 2026-07-01 17:00:05 +00:00
Fix oxlint errors in QP Discord notification files
All checks were successful
🚀 Deploy / 🧪 Test (pull_request) Successful in 2m53s
🚀 Deploy / ʦ🔍 Typecheck & Lint (pull_request) Successful in 1m18s
🚀 Deploy / 🐳 Build (pull_request) Has been skipped
🚀 Deploy / 🚀 Deploy (pull_request) Has been skipped
e492db660b
- Use import type for database (type-only usage)
- Replace non-null assertions with type casts (qualifyingPointsAwarded as string)
  and optional chaining (?.ownerId, league narrowing via explicit check)
- Eliminate Map.get()! after set() with if/else bucket pattern

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NnJP1NTYXHxL2kbE4fZaD6
chrisp merged commit b0c25beb90 into main 2026-07-01 17:29:46 +00:00
chrisp deleted branch claude/discord-qualifying-points-t55s3x 2026-07-01 17:29:46 +00:00
Sign in to join this conversation.
No description provided.