Files
turnosxpress/server/src/Models/Notifications/Notifications.Interface.ts
T

45 lines
1019 B
TypeScript

export enum NOTIFICATION_TYPES {
EMAIL = "EMAIL",
WAP = "WAP",
META_WAP = "META_WAP",
SYSTEM = "SYSTEM",
}
export type NotificationDataMeta = {
phoneNumber: string;
templateName: string;
languageCode: string;
// Si el template tiene variables, este array es obligatorio.
// Cada elemento mapea a {{1}}, {{2}}, {{3}}, etc.
templateVariables?: string[];
};
export type NotificationDataEmail = {
email: string;
subject?: string;
message?: string;
templateId?: string;
context?: Record<string, unknown>;
substitutions?: Record<string, string | number | boolean>;
};
export type NotificationDataWap = {
phoneNumber: string;
message: string;
companyId: string;
sessionUser: string;
};
export type NotificationDataSystem = {
userId: string;
conversationId?: string;
subject: string;
message: string;
type?: string;
code?: string;
};
export interface INotificationsAdapter<T> {
send: (data: T) => Promise<void>;
}