Notification Service — Migration Plan
Status: populated Owner: Platform Engineering Last updated: 2026-04-18
1. Context
Greenfield service. No predecessor. Migration plan covers schema creation, default template seeding, NATS consumer provisioning, and phased activation.
2. Pre-Launch Checklist
-
notifschema migrations applied to production PG. - All 6 default notification templates seeded and reviewed by Product/Marketing.
- NATS durable consumers created:
notif-auth-consumer,notif-billing-consumer,notif-operator-consumer,notif-system-consumer. - SendGrid API key provisioned and loaded into Vault
secret/notif/sendgrid_api_key. - SendGrid sender identity verified (SPF/DKIM/DMARC configured for
noreply@ghasi.io). - sms-orchestrator API key for notification SMS in Vault.
- NetworkPolicy restricting
/internal/*to admin-dashboard pod only applied.
3. Phased Rollout
| Phase | Duration | State |
|---|---|---|
| 0. Deploy silent | 2 days | Deploy with all NATS consumers disabled (NOTIF_CONSUMERS_ENABLED=false). Internal endpoints live. Seed templates. |
| 1. Activate billing consumer | 1 week | Enable notif-billing-consumer only. Monitor INVOICE_GENERATED email delivery. Validate PDF links, email formatting in staging. |
| 2. Activate auth consumer | 3 days | Enable notif-auth-consumer. Monitor USER_REGISTERED welcome email. |
| 3. Activate operator + system consumers | 3 days | Enable remaining consumers. Validate OPERATOR_DOWN email + SMS with test events. |
| 4. Full live | — | All consumers active; monitoring and alerts live. |
4. Template Seeding
Default templates for all 6 notification types are included in prisma/seed.prod.ts. Templates reviewed and approved by Product before Phase 1.
5. Rollback
- Per-consumer feature flag: disable individual consumers without stopping service.
- Schema rollback: only pre-launch; tables are append-only after activation.
6. Risks
See SERVICE_RISK_REGISTER: R-NOTIF-05 (templates not ready at launch), R-NOTIF-06 (SendGrid sender identity not verified).