- Add updateUser and resetUserPassword admin endpoints - Change company status from boolean to enum (registered, lead, customer, inactive) - Add 'important' event type to calendar validators and email templates - Add 1-hour-before event notifications cron job - Add 18:00 evening notifications for next-day events - Add contact description field support - Fix count() function usage in admin service - Add SQL migrations for schema changes Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
28 lines
1.1 KiB
JavaScript
28 lines
1.1 KiB
JavaScript
import { logger } from '../utils/logger.js';
|
|
import { startCalendarNotificationCron, startOneHourBeforeNotificationCron, startEveningNotificationCron, triggerEventNotifications, triggerSingleEventNotification } from './calendar/index.js';
|
|
import { startAuditCleanupCron, cleanupOldAuditLogs } from './cleanupAuditLogs.js';
|
|
|
|
/**
|
|
* Start all cron jobs
|
|
*/
|
|
export const startAllCronJobs = () => {
|
|
// Calendar event notifications (morning - configurable time)
|
|
const calendarJob = startCalendarNotificationCron();
|
|
logger.info(`Cron: ${calendarJob.name}`);
|
|
|
|
// 1-hour-before notifications (every hour)
|
|
const oneHourJob = startOneHourBeforeNotificationCron();
|
|
logger.info(`Cron: ${oneHourJob.name}`);
|
|
|
|
// Evening notifications at 18:00 for tomorrow's events
|
|
const eveningJob = startEveningNotificationCron();
|
|
logger.info(`Cron: ${eveningJob.name}`);
|
|
|
|
// Audit logs cleanup
|
|
const auditJob = startAuditCleanupCron();
|
|
logger.info(`Cron: ${auditJob.name}`);
|
|
};
|
|
|
|
// Export individual functions for testing/manual triggers
|
|
export { triggerEventNotifications, triggerSingleEventNotification, cleanupOldAuditLogs };
|