feat(notifications): P2a outbox table + pure dues-email logic
Migration 041 + schema.sql section 26: notifications outbox (service-only writer, admin/board/treasurer SELECT, member self-view via validated service action like member_billing; (space_id, dedupe_key) unique makes the webhook enqueue idempotent). lib/notifications-logic.ts is pure: deterministic dedupe keys, dues email rendering (HTML-escaped, brand- neutral), terminal-attempt rule. 13 tests. Inert until P2c wires it.
This commit is contained in:
@@ -190,6 +190,12 @@ export type Database = {
|
||||
Update: { event_id?: string; space_id?: string | null; type?: string | null; received_at?: string }
|
||||
Relationships: []
|
||||
}
|
||||
notifications: {
|
||||
Row: { id: string; space_id: string; member_id: string | null; type: string; channel: string; recipient: string; subject: string; body_html: string; body_text: string; status: string; attempts: number; last_error: string | null; dedupe_key: string; sent_at: string | null; created_at: string; updated_at: string }
|
||||
Insert: { id?: string; space_id: string; member_id?: string | null; type: string; channel?: string; recipient: string; subject: string; body_html: string; body_text: string; status?: string; attempts?: number; last_error?: string | null; dedupe_key: string; sent_at?: string | null; created_at?: string; updated_at?: string }
|
||||
Update: { id?: string; space_id?: string; member_id?: string | null; type?: string; channel?: string; recipient?: string; subject?: string; body_html?: string; body_text?: string; status?: string; attempts?: number; last_error?: string | null; dedupe_key?: string; sent_at?: string | null; created_at?: string; updated_at?: string }
|
||||
Relationships: []
|
||||
}
|
||||
activity_log: {
|
||||
Row: {
|
||||
action: string
|
||||
|
||||
Reference in New Issue
Block a user