feat: implement comprehensive notification engine with policies, preferences, and automated dispatching services

This commit is contained in:
2026-07-21 18:53:11 -03:00
parent 40090cdec5
commit 10ca449f88
82 changed files with 10249 additions and 171 deletions
@@ -0,0 +1,35 @@
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>;
}