- pnpm 10 workspace + TypeScript strict + ESLint flat + Prettier - CLAUDE.md as canonical brief - docs/tasks/ — 22 task briefs broken out by phase for sub-sessions - docs/decisions/ — ADR scaffold Implements task 01 (repo-init).
1.2 KiB
1.2 KiB
41 — Reminders engine
Goal
A generic, entity-agnostic reminder system that fires at fire_at and routes through the notification bus.
Depends on
- 40 (push), 42 (bus)
Scope
- Schema:
reminders(id,household_id,entity_type,entity_id,fire_attimestamptz,channeltext default'auto',fired_attimestamptz nullable,created_by). - Worker: a long-running tick (every 30s) that selects due un-fired reminders, calls
notify(...), marksfired_at. Runs in the same Node process viasetIntervalguarded by a Postgres advisory lock to allow future horizontal scaling. _core/reminders.tsexposesscheduleReminder(...),cancelReminder(id),listReminders(entityType, entityId).- Notes module's
remind_atfield callsscheduleReminderon save andcancelReminderwhen cleared. - Calendar module: optional "remind me" on event create (default 30 min before).
Out of scope
- Recurring reminders (use rrule later).
- Snooze.
Acceptance criteria
- A note with
remind_at = now + 1minfires within 90s and triggers a push notification. - Editing the note's
remind_atupdates the existing reminder, not creates duplicates. - Worker survives DB blips (caught + logged, not crashed).