From 55e6abc1616603f3d595545d3c918a46fba51c8c Mon Sep 17 00:00:00 2001 From: Matt Date: Tue, 5 May 2026 20:30:35 +0200 Subject: [PATCH] feat(finalization): winner email + UI for terminal rounds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When finalizing a round with no further round to advance to, passing teams are winners — not advancers. Detected for both special-award terminal rounds (label = award name) and the main competition's terminal round (label = competition name). Wording uses "a winner" so it works for both single-winner awards and top-N main-track outcomes. Adds AWARD_WINNER_NOTIFICATION email type + template ("Your project has won!" with "our team will reach out about next steps" copy). Routes through the notification dispatch table the same way ADVANCEMENT_NOTIFICATION does. The FinalizationSummary gains a `winnerContext` field; the admin finalization tab uses it to swap "X projects will advance to Y" → "X winners will be notified for [label]" and renames "Advancement Message" → "Winner Message" in the custom-message field. The email-preview button shows the winner template when applicable. In-app notification (bell icon) gets matching winner copy. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../admin/round/finalization-tab.tsx | 24 ++++- src/lib/email.ts | 88 +++++++++++++++ src/server/routers/roundEngine.ts | 32 ++++-- src/server/services/round-finalization.ts | 101 ++++++++++++++---- 4 files changed, 209 insertions(+), 36 deletions(-) diff --git a/src/components/admin/round/finalization-tab.tsx b/src/components/admin/round/finalization-tab.tsx index 4da11bd..df013b2 100644 --- a/src/components/admin/round/finalization-tab.tsx +++ b/src/components/admin/round/finalization-tab.tsx @@ -666,7 +666,9 @@ export function FinalizationTab({ roundId, roundStatus }: FinalizationTabProps) )}
- +