Add automatic lunch feature. Clean up some code.

This commit is contained in:
2025-10-23 15:34:09 -05:00
parent 40489be8e9
commit 7eb3a1dff0
7 changed files with 197 additions and 126 deletions

View File

@@ -4,10 +4,26 @@ import { api } from './_generated/api';
const crons = cronJobs();
// Runs at 5:00 PM America/Chicago, MondayFriday.
// Convex will handle DST if your project version supports `timeZone`.
crons.cron(
// Run at 7:00 AM CST / 8:00 AM CDT
// Only on weekdays
'Schedule Automatic Lunches',
'0 13 * * 1-5',
api.statuses.automaticLunch,
);
crons.cron(
// Run at 7:00 AM CST / 8:00 AM CDT
// Only on weekdays
'Schedule Automatic Lunches Test',
'25 18 * * 1-5',
api.statuses.automaticLunch,
);
crons.cron(
'End of shift (weekdays 5pm CT)',
// Run at 4:00 PM CST / 5:00 PM CDT
// Only on weekdays
'0 22 * * 1-5',
api.statuses.endOfShiftUpdate,
);