36 lines
1.0 KiB
TypeScript
36 lines
1.0 KiB
TypeScript
import { NotificationChannel } from "../NotificationJobs/NotificationJobs.Interface";
|
|
|
|
export interface QuietHours {
|
|
from: string; // "HH:mm" format, e.g. "22:00"
|
|
to: string; // "HH:mm" format, e.g. "07:00"
|
|
}
|
|
|
|
export interface ReminderRules {
|
|
offset: number; // minutes before appointment
|
|
enabled: boolean;
|
|
}
|
|
|
|
export interface ICompanyNotificationPolicy {
|
|
id?: string;
|
|
companyId: string;
|
|
defaultChannels: NotificationChannel[];
|
|
mutedChannels?: NotificationChannel[];
|
|
timezone: string;
|
|
quietHours?: QuietHours;
|
|
reminderRules?: ReminderRules[];
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
}
|
|
|
|
export interface FindCompanyPolicyParams {
|
|
companyId?: string;
|
|
}
|
|
|
|
export interface ICompanyNotificationPolicyAdapter {
|
|
findOne(filters: FindCompanyPolicyParams): Promise<ICompanyNotificationPolicy | null>;
|
|
upsert(
|
|
companyId: string,
|
|
data: Partial<Omit<ICompanyNotificationPolicy, "id" | "companyId" | "createdAt" | "updatedAt">>
|
|
): Promise<ICompanyNotificationPolicy>;
|
|
}
|