File

apps/recallassess/recallassess-api/src/jobs/subscription-renewal-reminder-schedule.service.ts

Description

Sends T-1 subscription renewal reminder emails while the API is running. Restores cron removed accidentally during the Apr 2026 invoice refactor.

Index

Properties
Methods

Constructor

constructor(billing: StripePaymentBillingHelpersService)
Parameters :
Name Type Optional
billing StripePaymentBillingHelpersService No

Methods

Async runOneDayRenewalReminderCron
runOneDayRenewalReminderCron()
Decorators :
@Cron('*/30 * * * *')
Returns : Promise<void>

Properties

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),
      );
    }
  }
}

results matching ""

    No results matching ""