feat(calendar): appointment reminders worker (PMS-58) #81

Merged
vas2000-work merged 3 commits from feat/pms-58-calendar-reminders into main 2026-06-05 05:02:28 +02:00
Owner

Follow-up to calendar/dispatch. CalendarService::with_dispatcher + CalendarReminderWorker (60s) expands occurrences in a near-future window and fires appointment.reminder per reminder_minutes offset to the assignee, deduped via a new appointment_reminders ledger. Migration 028 adds the ledger + seeds an in_app rule/template (also copied to new tenants). tests/calendar_reminders.rs green (enqueue + dedupe). clippy -D clean.

Follow-up to calendar/dispatch. CalendarService::with_dispatcher + CalendarReminderWorker (60s) expands occurrences in a near-future window and fires appointment.reminder per reminder_minutes offset to the assignee, deduped via a new appointment_reminders ledger. Migration 028 adds the ledger + seeds an in_app rule/template (also copied to new tenants). tests/calendar_reminders.rs green (enqueue + dedupe). clippy -D clean.
feat(calendar): appointment reminders worker (PMS-58)
All checks were successful
Check / fmt + clippy + compile + tests (pull_request) Successful in 2m48s
Build OCI container / Build and push mokosh-api image (push) Successful in 3m35s
1d020fbfc2
Follow-up to calendar/dispatch: fire appointment reminders. CalendarService gains a with_dispatcher constructor holding an optional NotificationsService. A new CalendarReminderWorker (scheduler Job, 60s) enumerates appointment occurrences in a near-future window (reusing the RRULE expansion), and for each occurrence + each reminder_minutes[] offset whose fire time has passed (and whose occurrence is still upcoming), dispatches appointment.reminder to the assignee, deduped via a new appointment_reminders ledger (UNIQUE(appointment_id, occurrence_start, reminder_minutes)) so a virtual recurring occurrence is reminded once per offset.

Migration 028 adds the ledger and seeds a default-tenant notification template + active rule for appointment.reminder (channel in_app); create_tenant copies them to new tenants. tests/calendar_reminders.rs asserts a due reminder enqueues one notification + ledger row and a second tick is a no-op.

#PMS-58

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Merge remote-tracking branch 'origin/main' into feat/pms-58-calendar-reminders
All checks were successful
Check / fmt + clippy + compile + tests (pull_request) Successful in 1m3s
Build OCI container / Build and push mokosh-api image (push) Successful in 3m15s
d00c3d0b1f
# Conflicts:
#	src/main.rs
#	src/modules/tenants/service.rs
Merge branch 'main' into feat/pms-58-calendar-reminders
All checks were successful
Create release / Create release from merged PR (pull_request) Has been skipped
Check / fmt + clippy + compile + tests (pull_request) Successful in 2m55s
Build OCI container / Build and push mokosh-api image (push) Successful in 7m7s
e922e0f599
vas2000-work deleted branch feat/pms-58-calendar-reminders 2026-06-05 05:02:29 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/mokosh-server!81
No description provided.