Add dueDate to reminders, remove reminder from notes

Schema changes:
- Added dueDate field to companyReminders table
- Removed reminderDate and reminderSent from notes table

Backend changes:
- Updated company-reminder.service with dueDate handling
- Added getUpcomingReminders function for dashboard
- Simplified note.service (removed reminder logic)
- Updated validators and routes

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
richardtekula
2025-12-01 11:21:54 +01:00
parent 947d1d9b99
commit ffaf916f5e
6 changed files with 82 additions and 113 deletions

View File

@@ -13,6 +13,7 @@ router.use(authenticate);
// Reminder summaries (must be before :companyId routes)
router.get('/reminders/summary', companyController.getReminderSummary);
router.get('/reminders/counts', companyController.getReminderCountsByCompany);
router.get('/reminders/upcoming', companyController.getUpcomingReminders);
// Company unread email summary
router.get('/email-unread', companyController.getCompanyUnreadCounts);
@@ -72,7 +73,6 @@ router.post(
validateParams(z.object({ companyId: z.string().uuid() })),
validateBody(z.object({
content: z.string().min(1),
reminderAt: z.string().optional().or(z.literal('')),
})),
companyController.addCompanyNote
);
@@ -85,7 +85,6 @@ router.patch(
})),
validateBody(z.object({
content: z.string().min(1).optional(),
reminderAt: z.string().optional().or(z.literal('').or(z.null())),
})),
companyController.updateCompanyNote
);