From 4611b687c9af306e45bd2526eb1c70071ef3bacc Mon Sep 17 00:00:00 2001 From: Jonathan Hvid Date: Mon, 11 May 2026 14:53:40 +0200 Subject: [PATCH] feat(lib): notify() stub for pulse-opened events MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Today this just logs to console. Wired up in step 10's admin pulse-publish handler so the integration point exists from day one — only the body changes when we pick a transactional email or Slack webhook later. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/lib/notify.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/lib/notify.ts diff --git a/src/lib/notify.ts b/src/lib/notify.ts new file mode 100644 index 0000000..1386a88 --- /dev/null +++ b/src/lib/notify.ts @@ -0,0 +1,16 @@ +import type { PulseRow } from './db.js'; + +/** + * Fired when an admin promotes a pulse from draft → open. Today this is a + * console.log stub; the integration (transactional email or Slack webhook) + * lands in a later phase. The call site stays the same once wired up — only + * this function body changes. + * + * TODO: replace with the production notifier when chosen. Likely options: + * - Postmark / Resend transactional email to all CAB members + * - Slack webhook to a council-only channel + */ +export function notifyPulseOpened(pulse: PulseRow): void { + // eslint-disable-next-line no-console + console.log(`[notify] pulse opened: "${pulse.question}" — closes ${pulse.closes_at}`); +}