The "Flags del envío" panel lived inside the Servicios tab and only
governed the four bulk jobs. The pólizas half had no debug at all, so
there was no way to test a renewal notice without mailing a real
customer. The panel now lives in the /notificaciones shell above the
tabs and both halves read it.
`debug` on the renewal path diverts to the same override inbox as the
servicios jobs and deliberately does NOT write the `RenewalNotice` row
or advance the sweep's `lastSuccessfulAt` — the customer was not
notified, so nothing may gate the letter they are still owed.
`ignoreDayRestriction` and `useEmailLimit` stay estado-de-cuenta-only
and are labelled as such.
Both automatic sweeps are now operator-editable. The renewal cadence
was a `@Cron("0 6 * * *")` literal and servicios had no automatic run
at all; both now resolve through `NotificationScheduleService`, which
stores the cadence in `app_settings` and reinstalls the cron job on
save — no redeploy, no restart. Defaults preserve current behaviour:
pólizas 06:00 daily, servicios off. A scheduled run never inherits the
UI flags; it always sends for real.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
23 lines
991 B
TypeScript
23 lines
991 B
TypeScript
import { Module } from "@nestjs/common";
|
|
import { NotificationLogModule } from "./notification-log.module";
|
|
import { NotificationScheduleModule } from "./notification-schedule.module";
|
|
import { SettingsModule } from "../settings/settings.module";
|
|
import { NotificationsController } from "./notifications.controller";
|
|
import { NotificationsService } from "./notifications.service";
|
|
|
|
/**
|
|
* Mass email notifications. MailModule is global (registered in AppModule),
|
|
* so this module needs no MailService import — it picks it up by injection.
|
|
*
|
|
* The automatic sweep is registered by `NotificationsService` against
|
|
* `NotificationScheduleService`, which owns the cadence for both halves of
|
|
* /notificaciones and stores it in `app_settings`.
|
|
*/
|
|
@Module({
|
|
imports: [NotificationLogModule, NotificationScheduleModule, SettingsModule],
|
|
controllers: [NotificationsController],
|
|
providers: [NotificationsService],
|
|
exports: [NotificationsService],
|
|
})
|
|
export class NotificationsModule {}
|