feat(lib): notify() stub for pulse-opened events

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) <noreply@anthropic.com>
This commit is contained in:
Jonathan Hvid 2026-05-11 14:53:40 +02:00
parent 351d90a3e8
commit 4611b687c9

16
src/lib/notify.ts Normal file
View file

@ -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}`);
}