feat: implement comprehensive notification engine with policies, preferences, and automated dispatching services
This commit is contained in:
@@ -5,6 +5,7 @@ import {
|
||||
AppointmentAdminByClientView,
|
||||
AppointmentAdminByDateView,
|
||||
CreateAppointmentParams,
|
||||
CreateImmediateAppointmentNotificationJobsParams,
|
||||
DeleteAppointmentParams,
|
||||
FindAppointmentsParams,
|
||||
FindAppointmentSchedulesParams,
|
||||
@@ -28,6 +29,7 @@ import { AppointmentService } from "./Appointments.Service";
|
||||
import { ApiVoidResult } from "../../Models/Api.VoidResult.type";
|
||||
import { TextObjectFilterResult } from "../../Models/TextObjectFilter.model";
|
||||
import { rateLimiter } from "../../middleware/ratelimiter";
|
||||
import { systemTokenMiddleware } from "../../middleware/systemToken";
|
||||
|
||||
@Route("appointments/create")
|
||||
@Middlewares(authenticateMiddleware)
|
||||
@@ -294,7 +296,7 @@ export class SendWapNotificationContrnoller extends Controller {
|
||||
}
|
||||
|
||||
@Route("appointments/send-wap-sys-notification")
|
||||
@Middlewares(rateLimiter)
|
||||
@Middlewares(systemTokenMiddleware)
|
||||
export class SendWapSystemNotificationContrnoller extends Controller {
|
||||
@Response<ApiValidationError>(500, "Ha ocurrido un error")
|
||||
@SuccessResponse(200, "Done")
|
||||
@@ -319,7 +321,7 @@ export class SendWapSystemNotificationContrnoller extends Controller {
|
||||
}
|
||||
|
||||
@Route("appointments/send-email-notification")
|
||||
@Middlewares(rateLimiter)
|
||||
@Middlewares([rateLimiter, systemTokenMiddleware])
|
||||
export class SendEmailNotificationContrnoller extends Controller {
|
||||
@Response<ApiValidationError>(500, "Ha ocurrido un error")
|
||||
@SuccessResponse(200, "Done")
|
||||
@@ -342,6 +344,30 @@ export class SendEmailNotificationContrnoller extends Controller {
|
||||
}
|
||||
}
|
||||
|
||||
@Route("appointments/create-immediate-notification-jobs")
|
||||
@Middlewares(authenticateMiddleware)
|
||||
export class CreateImmediateAppointmentNotificationJobsController extends Controller {
|
||||
@Response<ApiValidationError>(500, "Ha ocurrido un error")
|
||||
@SuccessResponse(200, "Done")
|
||||
@Post()
|
||||
public async createImmediateNotificationJobs(
|
||||
@Body() requestBody: CreateImmediateAppointmentNotificationJobsParams
|
||||
): Promise<ApiVoidResult | ApiValidationError> {
|
||||
try {
|
||||
await new AppointmentService().createImmediateNotificationJobs(requestBody);
|
||||
this.setStatus(200);
|
||||
return {
|
||||
message: "Done",
|
||||
success: true,
|
||||
};
|
||||
} catch (e) {
|
||||
const errorOccurred: Error = e as Error; console.error("GET EVENT ERROR:", errorOccurred);
|
||||
this.setStatus(500);
|
||||
return new ApiValidationError(500, errorOccurred.message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Route("appointments/apply-discount")
|
||||
@Middlewares(authenticateMiddleware)
|
||||
export class ApplyAppointmentDiscountContrnoller extends Controller {
|
||||
|
||||
Reference in New Issue
Block a user