67 lines
2.8 KiB
YAML
67 lines
2.8 KiB
YAML
|
|
# =====================================================================
|
||
|
|
# Notification Events
|
||
|
|
# =====================================================================
|
||
|
|
events:
|
||
|
|
|
||
|
|
notification.created.v1:
|
||
|
|
routing_key: notification.created.v1
|
||
|
|
description: A new in-app notification was created (also fans out to channels).
|
||
|
|
payload:
|
||
|
|
type: object
|
||
|
|
required: [notification_id, user_id, notification_type, title, message]
|
||
|
|
properties:
|
||
|
|
notification_id: { type: string, format: uuid }
|
||
|
|
tenant_id: { type: string, format: uuid }
|
||
|
|
user_id: { type: string, format: uuid }
|
||
|
|
notification_type:
|
||
|
|
type: string
|
||
|
|
enum: [RenderCompleted, RenderFailed, RenderProgress,
|
||
|
|
PlanExpiring, PlanExpired, PaymentSuccess, PaymentFailed,
|
||
|
|
StorageWarning, StorageFull, ExportExpiring, ExportDeleted,
|
||
|
|
GiftEarned, QuestCompleted, LevelUp,
|
||
|
|
AccountSecurity, SystemAnnouncement, TenantInvite,
|
||
|
|
Marketing, Other]
|
||
|
|
priority: { type: string, enum: [Low, Normal, High, Urgent] }
|
||
|
|
title: { type: string }
|
||
|
|
message: { type: string }
|
||
|
|
action_url: { type: string, nullable: true }
|
||
|
|
# Fan-out routing — which channels to deliver to
|
||
|
|
channels:
|
||
|
|
type: array
|
||
|
|
items: { type: string, enum: [InApp, Push, Email, SMS, Telegram, Webhook] }
|
||
|
|
|
||
|
|
notification.delivered.v1:
|
||
|
|
routing_key: notification.delivered.v1
|
||
|
|
payload:
|
||
|
|
type: object
|
||
|
|
required: [delivery_id, notification_id, channel, status]
|
||
|
|
properties:
|
||
|
|
delivery_id: { type: string, format: uuid }
|
||
|
|
notification_id: { type: string, format: uuid }
|
||
|
|
tenant_id: { type: string, format: uuid }
|
||
|
|
user_id: { type: string, format: uuid }
|
||
|
|
channel: { type: string, enum: [InApp, Push, Email, SMS, Telegram, Webhook] }
|
||
|
|
status: { type: string, enum: [Sent, Delivered] }
|
||
|
|
provider: { type: string }
|
||
|
|
provider_message_id: { type: string, nullable: true }
|
||
|
|
sent_at: { type: string, format: date-time }
|
||
|
|
delivered_at: { type: string, format: date-time, nullable: true }
|
||
|
|
|
||
|
|
notification.failed.v1:
|
||
|
|
routing_key: notification.failed.v1
|
||
|
|
payload:
|
||
|
|
type: object
|
||
|
|
required: [delivery_id, channel, error_message]
|
||
|
|
properties:
|
||
|
|
delivery_id: { type: string, format: uuid }
|
||
|
|
notification_id: { type: string, format: uuid, nullable: true }
|
||
|
|
tenant_id: { type: string, format: uuid }
|
||
|
|
user_id: { type: string, format: uuid }
|
||
|
|
channel: { type: string }
|
||
|
|
attempt: { type: integer }
|
||
|
|
max_attempts: { type: integer }
|
||
|
|
error_code: { type: string, nullable: true }
|
||
|
|
error_message: { type: string }
|
||
|
|
will_retry: { type: boolean }
|
||
|
|
next_retry_at: { type: string, format: date-time, nullable: true }
|