feat: invoice due date email alerts, add favicon
- Daily cron (8:00 AM) checks created and received invoices - Alerts 3 days before due date and on due date - Summary email to INVOICE_ALERT_EMAIL with grouped tables - Tracks sent alerts in invoice_alert_log to prevent duplicates - node-cron scheduler runs inside the app process - Favicon files copied from PHP project Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -177,6 +177,21 @@ async function start() {
|
||||
});
|
||||
}
|
||||
|
||||
// --- Invoice alert cron (daily at 8:00 AM) ---
|
||||
if (config.email.invoiceAlert) {
|
||||
const cron = await import("node-cron");
|
||||
cron.default.schedule("0 8 * * *", async () => {
|
||||
try {
|
||||
const { checkInvoiceAlerts } =
|
||||
await import("./services/invoice-alerts");
|
||||
await checkInvoiceAlerts();
|
||||
} catch (err) {
|
||||
app.log.error(err, "Invoice alert cron failed");
|
||||
}
|
||||
});
|
||||
console.log("Invoice alert cron scheduled (daily 8:00)");
|
||||
}
|
||||
|
||||
// --- Start ---
|
||||
const port = config.isProduction ? config.port : 3000;
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user