- 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>
10 lines
394 B
SQL
10 lines
394 B
SQL
CREATE TABLE `invoice_alert_log` (
|
|
`id` INT NOT NULL AUTO_INCREMENT,
|
|
`invoice_type` VARCHAR(20) NOT NULL,
|
|
`invoice_id` INT NOT NULL,
|
|
`alert_type` VARCHAR(20) NOT NULL,
|
|
`sent_at` DATETIME(0) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
PRIMARY KEY (`id`),
|
|
UNIQUE KEY `invoice_type_invoice_id_alert_type` (`invoice_type`, `invoice_id`, `alert_type`)
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|