2023-12-19 18:08:17 +01:00
|
|
|
import { NotificationTemplateChannel } from "@app/core/common/enum/notification-template-channel";
|
|
|
|
import { NotificationTemplateKind } from "@app/core/common/enum/notification-template-kind";
|
|
|
|
import { BaseEntity, BaseEntityPersist } from "@common/base/base-entity.model";
|
|
|
|
import { Guid } from "@common/types/guid";
|
|
|
|
import { NotificationDataType } from "@app/core/common/enum/notification-data-type";
|
|
|
|
import { EmailOverrideMode } from "@app/core/common/enum/email-override-mode";
|
2024-01-12 17:32:27 +01:00
|
|
|
import { NotificationType } from "@app/core/common/enum/notification-type";
|
2023-12-19 18:08:17 +01:00
|
|
|
|
|
|
|
export interface NotificationTemplate extends BaseEntity{
|
|
|
|
channel: NotificationTemplateChannel;
|
2024-01-12 17:32:27 +01:00
|
|
|
notificationType: NotificationType;
|
2023-12-19 18:08:17 +01:00
|
|
|
kind: NotificationTemplateKind;
|
2024-04-04 15:39:40 +02:00
|
|
|
languageCode: string;
|
2023-12-19 18:08:17 +01:00
|
|
|
value: NotificationTemplateValue;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface NotificationTemplateValue {
|
|
|
|
subjectText: string;
|
|
|
|
subjectKey: string;
|
|
|
|
subjectFieldOptions: NotificationFieldOptions;
|
|
|
|
bodyText: string;
|
|
|
|
bodyKey: string;
|
|
|
|
priorityKey: string;
|
|
|
|
allowAttachments: Boolean;
|
|
|
|
cc: string[];
|
|
|
|
ccMode: EmailOverrideMode;
|
|
|
|
bcc: string[];
|
|
|
|
bccMode: EmailOverrideMode;
|
|
|
|
extraDataKeys: string[];
|
|
|
|
bodyFieldOptions: NotificationFieldOptions;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface NotificationFieldOptions {
|
|
|
|
mandatory?: string[];
|
2023-12-20 17:02:55 +01:00
|
|
|
optional?: NotificationFieldInfo[];
|
2023-12-19 18:08:17 +01:00
|
|
|
formatting?: { [key: string]: string };
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface NotificationFieldInfo {
|
|
|
|
key: string;
|
2023-12-20 17:02:55 +01:00
|
|
|
type: NotificationDataType,
|
2023-12-19 18:08:17 +01:00
|
|
|
value: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Persist
|
|
|
|
|
|
|
|
export interface NotificationTemplatePersist extends BaseEntityPersist{
|
|
|
|
channel: NotificationTemplateChannel;
|
2024-01-12 17:32:27 +01:00
|
|
|
notificationType: NotificationType;
|
2023-12-19 18:08:17 +01:00
|
|
|
kind: NotificationTemplateKind;
|
2024-04-04 15:39:40 +02:00
|
|
|
languageCode: string;
|
2023-12-19 18:08:17 +01:00
|
|
|
value: NotificationTemplateValuePersist;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface NotificationTemplateValuePersist {
|
|
|
|
subjectText: string;
|
|
|
|
subjectKey: string;
|
|
|
|
subjectFieldOptions: NotificationFieldOptionsPersist;
|
|
|
|
bodyText: string;
|
|
|
|
bodyKey: string;
|
|
|
|
priorityKey: string;
|
|
|
|
allowAttachments: Boolean;
|
|
|
|
cc: string[];
|
|
|
|
ccMode: EmailOverrideMode;
|
|
|
|
bcc: string[];
|
|
|
|
bccMode: EmailOverrideMode;
|
|
|
|
extraDataKeys: string[];
|
|
|
|
bodyFieldOptions: NotificationFieldOptionsPersist;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface NotificationFieldOptionsPersist {
|
|
|
|
mandatory?: string[];
|
2023-12-20 17:02:55 +01:00
|
|
|
optional?: NotificationFieldInfoPersist[];
|
2023-12-19 18:08:17 +01:00
|
|
|
formatting?: { [key: string]: string };
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface NotificationFieldInfoPersist {
|
|
|
|
key: string;
|
2023-12-20 17:02:55 +01:00
|
|
|
type: NotificationDataType,
|
2023-12-19 18:08:17 +01:00
|
|
|
value: string;
|
2024-04-04 15:39:40 +02:00
|
|
|
}
|