feat: Add user management APIs, status enum, enhanced notifications

- 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>
This commit is contained in:
richardtekula
2026-01-15 09:41:29 +01:00
parent 5d01fc9542
commit 70fa080455
13 changed files with 423 additions and 19 deletions

View File

@@ -1,15 +1,23 @@
import { logger } from '../utils/logger.js';
import { startCalendarNotificationCron, triggerEventNotifications, triggerSingleEventNotification } from './calendar/index.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
// 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}`);