82 lines
2.4 KiB
TypeScript
82 lines
2.4 KiB
TypeScript
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";
|
|
import { NotificationType } from "@app/core/common/enum/notification-type";
|
|
|
|
export interface NotificationTemplate extends BaseEntity{
|
|
channel: NotificationTemplateChannel;
|
|
notificationType: NotificationType;
|
|
kind: NotificationTemplateKind;
|
|
languageCode: string;
|
|
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[];
|
|
optional?: NotificationFieldInfo[];
|
|
formatting?: { [key: string]: string };
|
|
}
|
|
|
|
export interface NotificationFieldInfo {
|
|
key: string;
|
|
type: NotificationDataType,
|
|
value: string;
|
|
}
|
|
|
|
// Persist
|
|
|
|
export interface NotificationTemplatePersist extends BaseEntityPersist{
|
|
channel: NotificationTemplateChannel;
|
|
notificationType: NotificationType;
|
|
kind: NotificationTemplateKind;
|
|
languageCode: string;
|
|
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[];
|
|
optional?: NotificationFieldInfoPersist[];
|
|
formatting?: { [key: string]: string };
|
|
}
|
|
|
|
export interface NotificationFieldInfoPersist {
|
|
key: string;
|
|
type: NotificationDataType,
|
|
value: string;
|
|
}
|