brackt/app/routes/leagues
Chris Parsons 79f7a41837
Add Discord webhook notifications for standings updates (#157)
* Add Discord webhook notifications for standings updates

Adds a Discord webhook integration that posts standings to a configured
Discord channel whenever scores change after a scoring event. Commissioners
set the webhook URL in league settings and can send a test notification.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* Fix Discord notification edge cases from code review

- Fix point delta sign: negative diffs now correctly show -5 pts not +-5 pts
- Replace hardcoded soccer emoji with a neutral bullet (works for all sports)
- Truncate embed description at Discord's 4096-char limit
- Thread eventId through processMatchResult and bracket batch handler so
  scored matches appear in single-match notifications too
- Pass eventName to finalizeQualifyingPoints ("Final Standings") and
  processSeasonStandings ("Season Complete") so those notifications have context
- Test notification now fetches current season to show "League 2025" format

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* Fix process-match-result tests: add sportsSeasons to db mock

recalculateAffectedLeagues now queries sportsSeasons to get the sport
name for Discord notifications; the test mock db needed the stub added.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-17 11:16:36 -07:00
..
__tests__ Partial bracket scoring, code review fixes, and double-chance logic (#156) 2026-03-17 10:50:30 -07:00
$leagueId.draft-board.$seasonId.tsx feat: add meta title to all route pages (#109) 2026-03-10 12:10:52 -07:00
$leagueId.draft.$seasonId.tsx feat: add meta title to all route pages (#109) 2026-03-10 12:10:52 -07:00
$leagueId.server.ts Add event_starts_at timestamp to scoring events for sub-day ordering (#146) 2026-03-15 10:22:42 -07:00
$leagueId.settings.tsx Add Discord webhook notifications for standings updates (#157) 2026-03-17 11:16:36 -07:00
$leagueId.sports-seasons.$sportsSeasonId.server.ts Fix First Four appearing out of order in NCAA bracket display (#152) 2026-03-16 12:27:43 -07:00
$leagueId.sports-seasons.$sportsSeasonId.tsx feat: add meta title to all route pages (#109) 2026-03-10 12:10:52 -07:00
$leagueId.standings.$seasonId.teams.$teamId.tsx Simplify team breakdown page layout and fix code quality issues (#155) 2026-03-17 09:20:41 -07:00
$leagueId.standings.$seasonId.tsx feat: add meta title to all route pages (#109) 2026-03-10 12:10:52 -07:00
$leagueId.tsx Display upcoming matches (#141) 2026-03-12 10:12:38 -07:00
new.tsx feat: add meta title to all route pages (#109) 2026-03-10 12:10:52 -07:00