feat(contracts): add notification.requested event schema (GOO-173)
Phase 1 RFC-004 prep — define the event contract that the notifications module will publish through the Phase 0 outbox + Redis Streams backbone. - Add notification.requested.schema.json (JSON Schema 2020-12) covering notificationId, userId, category, template, params, channels, locale, priority, dedupeKey, requestedAt - Add NotificationRequestedPayload + supporting union types (NotificationCategory, NotificationChannel, NotificationLocale, NotificationPriority) to @goodgo/contracts-events barrel - Register 'notification.requested' in KNOWN_EVENT_TYPES Pure contract addition; no producer/consumer wiring yet (follow-up commits in this branch will introduce the publisher refactor + BullMQ worker). Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
@@ -2,6 +2,7 @@ export const KNOWN_EVENT_TYPES = [
|
||||
'kyc.verified',
|
||||
'listing.approved',
|
||||
'payment.completed',
|
||||
'notification.requested',
|
||||
] as const;
|
||||
|
||||
export type KnownEventType = (typeof KNOWN_EVENT_TYPES)[number];
|
||||
|
||||
@@ -35,3 +35,34 @@ export interface KycVerifiedPayload {
|
||||
verifiedAt: string;
|
||||
documentRefs: string[];
|
||||
}
|
||||
|
||||
export type NotificationCategory =
|
||||
| 'auth'
|
||||
| 'kyc'
|
||||
| 'listing'
|
||||
| 'payment'
|
||||
| 'subscription'
|
||||
| 'inquiry'
|
||||
| 'lead'
|
||||
| 'agent'
|
||||
| 'residential'
|
||||
| 'system';
|
||||
|
||||
export type NotificationChannel = 'email' | 'sms' | 'zalo' | 'fcm' | 'in_app';
|
||||
|
||||
export type NotificationLocale = 'vi' | 'en';
|
||||
|
||||
export type NotificationPriority = 'low' | 'normal' | 'high' | 'critical';
|
||||
|
||||
export interface NotificationRequestedPayload {
|
||||
notificationId: string;
|
||||
userId: string;
|
||||
category: NotificationCategory;
|
||||
template: string;
|
||||
params: Record<string, unknown>;
|
||||
channels: NotificationChannel[];
|
||||
locale?: NotificationLocale;
|
||||
priority?: NotificationPriority;
|
||||
dedupeKey?: string;
|
||||
requestedAt: string;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user