feat: enhance reminder functionality with version tracking for shifts

Introduced a new column `version_at` in the shifts table to track the last change time of a shift's version. Updated reminder logic to skip reminders that are due before the shift's version change or the signup time. Modified related functions and tests to ensure correct behavior when managing reminders for shifts and signups, including scenarios for late signups and shift changes.
This commit is contained in:
blake committed 2026-11-02 12:00:42 -06:00
1 parent 71130c3e8e
commit 17ca2f9dfb
6 files changed
+116 -16

No files matched your search

+1 -1
View File
@@ -216,7 +216,7 @@ function insertSignup(db: Awaited<ReturnType<typeof buildApp>>['db'], shiftId: n
`INSERT INTO signups (
shift_id, name, email, email_norm, is_minor, group_size, status, reminders_off, created_at, updated_at
) VALUES (?, 'Ada', 'ada@example.invalid', 'ada@example.invalid', 0, 1, 'confirmed', 0, ?, ?)`,
).run(shiftId, NOW, NOW);
).run(shiftId, '2026-10-13T18:00:00.000Z', '2026-10-13T18:00:00.000Z');
}
function magicToken(db: Awaited<ReturnType<typeof buildApp>>['db']): string {