brackt/app/services/match-sync
Claude 8900bf79dc
Announce drafted tennis players eliminated in non-scoring rounds
A player drafted in a tennis major (e.g. Jakob Mensik, out in the Round of
64) got no Discord announcement when the bracket was scored by sync. The
first three Grand Slam rounds are non-scoring, so an early-round loser earns
0 QP, gets no event_results row, and is dropped from the
"Qualifying Points Update" notification — the only announcement the tennis
sync emits mid-tournament.

Detect players knocked out on each sync and surface them:

- populateBracketFromDraw now returns newlyDecidedLoserIds: losers of
  matches that transition to complete on this run. Idempotent across
  re-syncs since playoff_matches persist, so a knockout is announced once.
- syncTennisDraw threads that set into notifyQualifyingPointsUpdate and
  fires the notification even when no QP changed.
- notifyQualifyingPointsUpdate builds an eliminated list scoped to players
  drafted in the league, deduped against QP earners (so a Round-of-16 loser
  who scores isn't listed twice), tagging the drafting manager.
- sendQualifyingPointsUpdateNotification renders a "Knocked Out" section and
  pings those managers; the QP Standings block is skipped when a sync only
  reports knockouts.

Tests cover the new detection, dedup, manager tagging, knockout-only
notifications, and rendering.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LkPWxSCunhPFknNUTXm4aZ
2026-07-03 14:42:06 +00:00
..
__tests__ claude/discord-qp-notifications-75wa7k (#122) 2026-07-01 22:14:51 +00:00
espn-schedule.ts claude/great-lovelace-r3bznh (#88) 2026-06-12 22:35:35 +00:00
index.ts Announce drafted tennis players eliminated in non-scoring rounds 2026-07-03 14:42:06 +00:00
pandascore.ts claude/great-lovelace-r3bznh (#88) 2026-06-12 22:35:35 +00:00
tennis-draw-mapping.ts Auto-populate & auto-score tennis Grand Slam brackets from Wikipedia 2026-06-26 21:48:00 -07:00
types.ts Auto-populate & auto-score tennis Grand Slam brackets from Wikipedia 2026-06-26 21:48:00 -07:00
wikipedia-tennis.ts Auto-populate & auto-score tennis Grand Slam brackets from Wikipedia 2026-06-26 21:48:00 -07:00