mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-30 08:48:11 +00:00
feat: add destination to the notification
This commit is contained in:
@@ -13,7 +13,11 @@ export enum NotificationAudience {
|
||||
BACKOFFICE = "BACKOFFICE",
|
||||
}
|
||||
|
||||
/** Drives channel fan-out: HIGH also pushes email/SMS, NORMAL is in-app only. */
|
||||
/**
|
||||
* Default channel fan-out when {@link NotifyInput.channels} is not given:
|
||||
* HIGH also pushes email/SMS, NORMAL is in-app only. An explicit `channels`
|
||||
* selection overrides this.
|
||||
*/
|
||||
export enum NotificationPriority {
|
||||
NORMAL = "NORMAL",
|
||||
HIGH = "HIGH",
|
||||
@@ -36,6 +40,19 @@ export enum NotificationType {
|
||||
CLEARANCE_REVIEW = "CLEARANCE_REVIEW",
|
||||
}
|
||||
|
||||
/**
|
||||
* Explicit fan-out channel selection for a single `notify(...)` call.
|
||||
*
|
||||
* In-app delivery is always performed (this module is an inbox) and is not
|
||||
* listed here. These flags control the *extra* outbound channels. When omitted
|
||||
* on {@link NotifyInput}, channels fall back to priority: HIGH ⇒ email + SMS,
|
||||
* NORMAL ⇒ none.
|
||||
*/
|
||||
export interface NotificationChannels {
|
||||
email?: boolean;
|
||||
sms?: boolean;
|
||||
}
|
||||
|
||||
/** Optional per-channel delivery outcome recorded on the notification row. */
|
||||
export interface NotificationChannelsSent {
|
||||
email?: boolean;
|
||||
@@ -82,6 +99,12 @@ export interface NotifyInput {
|
||||
link?: string | null;
|
||||
data?: Record<string, unknown> | null;
|
||||
priority?: NotificationPriority;
|
||||
/**
|
||||
* Explicit email/SMS fan-out. Overrides the priority-based default when set;
|
||||
* omit to let `priority` decide (HIGH ⇒ email + SMS, NORMAL ⇒ in-app only).
|
||||
* In-app is always delivered regardless.
|
||||
*/
|
||||
channels?: NotificationChannels;
|
||||
}
|
||||
|
||||
/** Paginated list envelope for the notifications list endpoint. */
|
||||
|
||||
Reference in New Issue
Block a user