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
@@ -58,8 +58,10 @@ export class CompaniesAdapterMongoose implements ICompaniesAdapter {
templateWapNotifId: { type: Schema.Types.ObjectId, required: false, ref: "Template" },
templateWapAltaId: { type: Schema.Types.ObjectId, required: false, ref: "Template" },
templateWapCancellationId: { type: Schema.Types.ObjectId, required: false, ref: "Template" },
templateEmailNotifId: { type: Schema.Types.ObjectId, required: false, ref: "Template" },
templateEmailAltaId: { type: Schema.Types.ObjectId, required: false, ref: "Template" },
templateEmailCancellationId: { type: Schema.Types.ObjectId, required: false, ref: "Template" },
onboardingStep: { type: Number, required: false, default: 0 },
onboardingCompleted: { type: Boolean, required: false, default: false },
@@ -205,6 +207,10 @@ export class CompaniesAdapterMongoose implements ICompaniesAdapter {
updateCompany.templateWapAltaId = data.templateWapAltaId;
}
if (data.templateWapCancellationId) {
updateCompany.templateWapCancellationId = data.templateWapCancellationId;
}
if (data.templateEmailNotifId) {
updateCompany.templateEmailNotifId = data.templateEmailNotifId;
}
@@ -213,6 +219,10 @@ export class CompaniesAdapterMongoose implements ICompaniesAdapter {
updateCompany.templateEmailAltaId = data.templateEmailAltaId;
}
if (data.templateEmailCancellationId) {
updateCompany.templateEmailCancellationId = data.templateEmailCancellationId;
}
if (data.onboardingStep !== undefined) {
updateCompany.onboardingStep = data.onboardingStep;
}
@@ -47,8 +47,10 @@ export type UpdateCompanyParams = {
sessionUser: string;
templateWapNotifId?: string;
templateWapAltaId?: string;
templateWapCancellationId?: string;
templateEmailNotifId?: string;
templateEmailAltaId?: string;
templateEmailCancellationId?: string;
onboardingStep?: number;
onboardingCompleted?: boolean;
banned?: boolean;
@@ -144,8 +146,10 @@ export interface ICompany {
automaticNotifications?: boolean;
templateWapNotifId?: string;
templateWapAltaId?: string;
templateWapCancellationId?: string;
templateEmailNotifId?: string;
templateEmailAltaId?: string;
templateEmailCancellationId?: string;
onboardingStep?: number;
onboardingCompleted?: boolean;
fixedPostIds?: Array<string>;
@@ -192,8 +196,10 @@ export interface MyOranizationsView {
appointmentAlert?: string;
templateWapNotifId?: string;
templateWapAltaId?: string;
templateWapCancellationId?: string;
templateEmailNotifId?: string;
templateEmailAltaId?: string;
templateEmailCancellationId?: string;
onboardingStep?: number;
onboardingCompleted?: boolean;
banned?: boolean;