apps/recallassess/recallassess-api/src/jobs/subscription-renewal-reminder-schedule.service.ts
Sends T-1 subscription renewal reminder emails while the API is running. Restores cron removed accidentally during the Apr 2026 invoice refactor.
Properties |
|
Methods |
constructor(billing: StripePaymentBillingHelpersService)
|
||||||
|
Parameters :
|
| Async runOneDayRenewalReminderCron |
runOneDayRenewalReminderCron()
|
Decorators :
@Cron('*/30 * * * *')
|
|
Returns :
Promise<void>
|
| Private Readonly logger |
Type : unknown
|
Default value : new Logger(SubscriptionRenewalReminderScheduleService.name)
|
import { StripePaymentBillingHelpersService } from "@api/shared/stripe/services/stripe-payment/stripe-payment-billing-helpers.service";
import { Injectable, Logger } from "@nestjs/common";
import { Cron } from "@nestjs/schedule";
/**
* Sends T-1 subscription renewal reminder emails while the API is running.
* Restores cron removed accidentally during the Apr 2026 invoice refactor.
*/
@Injectable()
export class SubscriptionRenewalReminderScheduleService {
private readonly logger = new Logger(SubscriptionRenewalReminderScheduleService.name);
constructor(private readonly billing: StripePaymentBillingHelpersService) {}
@Cron("*/30 * * * *")
async runOneDayRenewalReminderCron(): Promise<void> {
try {
await this.billing.sendOneDayRenewalReminderEmails();
} catch (err) {
this.logger.error(
"runOneDayRenewalReminderCron failed",
err instanceof Error ? err.stack : String(err),
);
}
}
}