Notification Service — Event Schemas
Status: populated Owner: Platform Engineering Last updated: 2026-04-18
This service is a pure consumer of NATS events. It publishes no NATS events.
1. Consumed Subjects
| Subject | Stream | Producer | Consumer group | Notifications triggered |
|---|---|---|---|---|
auth.events | AUTH_EVENTS | auth-service | notif-auth-consumer | USER_REGISTERED email |
billing.events | BILLING_EVENTS | billing-service | notif-billing-consumer | INVOICE_GENERATED email |
operator.health | OPERATOR_HEALTH | operator-management-service | notif-operator-consumer | OPERATOR_DOWN email + SMS |
system.alerts | SYSTEM_ALERTS | multiple | notif-system-consumer | SYSTEM_ALERT email/SMS by severity |
2. Consumed Event Schemas
auth.user.registered.v1 (from auth.events)
interface AuthUserRegistered {
schemaVersion: '1';
userId: string;
accountId: string;
tenantId: string;
email: string;
registeredAt: string;
}
→ Triggers: USER_REGISTERED email to userId.
billing.invoice.generated.v1 (from billing.events)
interface BillingInvoiceGenerated {
schemaVersion: '1';
invoiceId: string;
accountId: string;
tenantId: string;
periodStart: string;
periodEnd: string;
totalMessages: number;
subtotalAmount: string;
currency: string;
s3Key: string;
generatedAt: string;
}
→ Triggers: INVOICE_GENERATED email to all account.admin users of accountId.
operator.health.status_changed.v1 (from operator.health)
interface OperatorHealthStatusChanged {
schemaVersion: '1';
operatorId: string;
operatorName: string;
previousStatus: 'UP' | 'DEGRADED' | 'DOWN';
newStatus: 'UP' | 'DEGRADED' | 'DOWN';
reason: string;
at: string;
}
→ Triggers: OPERATOR_DOWN email + SMS to platform.admin users when newStatus = 'DOWN'.
→ Triggers: OPERATOR_RECOVERED email when newStatus = 'UP' (recovery notification).
system.alerts.raised.v1 (from system.alerts)
interface SystemAlertRaised {
schemaVersion: '1';
alertId: string;
severity: 'INFO' | 'WARN' | 'CRITICAL';
title: string;
detail: string;
source: string;
raisedAt: string;
}
→ Triggers:
CRITICAL:SYSTEM_SECURITY_ALERTemail + SMS toplatform.admin(ignores opt-out).WARN:SYSTEM_INFO_ALERTemail toplatform.admin(respects opt-out).INFO:SYSTEM_INFO_ALERTemail toplatform.admin(respects opt-out, lower priority).
3. Event Routing Table
| Event type | Notification type | Channels | Category | Opt-out respected |
|---|---|---|---|---|
auth.user.registered.v1 | USER_REGISTERED | ACCOUNT | No | |
billing.invoice.generated.v1 | INVOICE_GENERATED | BILLING | No | |
operator.health.status_changed.v1 (DOWN) | OPERATOR_DOWN | EMAIL + SMS | OPERATOR_ALERT | Yes |
operator.health.status_changed.v1 (UP from DOWN) | OPERATOR_RECOVERED | OPERATOR_ALERT | Yes | |
system.alerts.raised.v1 (CRITICAL) | SYSTEM_SECURITY_ALERT | EMAIL + SMS | SYSTEM_SECURITY | No |
system.alerts.raised.v1 (WARN/INFO) | SYSTEM_INFO_ALERT | SYSTEM_INFO | Yes |
4. PII Policy
auth.user.registered.v1containsemail— do not log raw email; store masked form innotification_log.recipient_address.- SMS recipient phone numbers: E.164 format in delivery call; masked in logs.
- NATS consumer does not forward event payloads to external systems unredacted.