fix: bug in the send reminder send

This commit is contained in:
mahyargdz
2025-03-08 21:55:24 +03:30
parent 15187680ce
commit 65535af4f7
5 changed files with 13 additions and 11 deletions
@@ -96,10 +96,10 @@ export class InvoicesService {
INVOICE.INVOICE_REMINDER_JOB_NAME,
{ invoiceId: invoice.id },
{
delay: dayjs(invoice.dueDate).subtract(3, "day").diff(dayjs()),
// delay: dayjs(invoice.dueDate).subtract(INVOICE.DAYS_BEFORE_OVERDUE, "day").diff(dayjs()),
delay: 900000, // 15 minutes in milliseconds
attempts: INVOICE.INVOICE_REMINDER_JOB_ATTEMPTS,
backoff: INVOICE.INVOICE_REMINDER_JOB_BACKOFF,
repeat: { every: 300000 }, // Repeat every 5 minutes (300,000 ms)
},
);
@@ -198,6 +198,8 @@ export class InvoicesService {
queryRunner,
);
await this.otpService.delOtpFormCache(user.phone, "INVOICE_VERIFY");
await queryRunner.commitTransaction();
return {
@@ -255,7 +257,8 @@ export class InvoicesService {
INVOICE.INVOICE_REMINDER_JOB_NAME,
{ invoiceId: invoice.id },
{
delay: dayjs(invoice.dueDate).subtract(INVOICE.DAYS_BEFORE_OVERDUE, "day").diff(dayjs()),
// delay: dayjs(invoice.dueDate).subtract(INVOICE.DAYS_BEFORE_OVERDUE, "day").diff(dayjs()),
delay: 900000, // 15 minutes in milliseconds
attempts: INVOICE.INVOICE_REMINDER_JOB_ATTEMPTS,
backoff: INVOICE.INVOICE_REMINDER_JOB_BACKOFF,
repeat: { every: 300000 },