feat(calendar): RRULE expansion + dispatch view (PMS-58) #77

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

Implements PMS-58 core. Recurring appointments expand at read time via the rrule crate (bounded by the query range, capped per series, recurrence_parent_id set, not materialized); create persists recurrence_rule + rejects non-positive duration. /api/v1/dispatch replaces its 501 stub with a real aggregated view (appointments + availability + approved time-off + on-call). tests/calendar.rs 6/6 + dispatch_stub rewritten. rrule added; clippy -D warnings clean. Reminder dispatch deferred (needs notifications handle + sent-reminder ledger).

Implements PMS-58 core. Recurring appointments expand at read time via the rrule crate (bounded by the query range, capped per series, recurrence_parent_id set, not materialized); create persists recurrence_rule + rejects non-positive duration. /api/v1/dispatch replaces its 501 stub with a real aggregated view (appointments + availability + approved time-off + on-call). tests/calendar.rs 6/6 + dispatch_stub rewritten. rrule added; clippy -D warnings clean. Reminder dispatch deferred (needs notifications handle + sent-reminder ledger).
feat(calendar): RRULE expansion + dispatch view (PMS-58)
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 6m35s
d5e9b1b278
PMS-58: implement the missing calendar working components.

Recurring appointments now expand at read time: the range query parses each appointment's recurrence_rule (RFC 5545, rrule crate), expands occurrences within the requested [from,to] window (capped per series, never materialized), and emits one instance per occurrence carrying recurrence_parent_id. Appointment create now persists recurrence_rule and rejects end_time <= start_time.

The /api/v1/dispatch route is no longer a 501 stub: a real aggregated view returns appointments (expanded) + user availability + approved time off + current on-call for a date range, optionally narrowed by assignee. Adds the rrule dependency.

Integration tests in tests/calendar.rs cover booking + range query, zero-duration rejection, a FREQ=DAILY;COUNT=3 series expanding to three linked instances, range-bounded clipping, time-off approve/reject, and the dispatch aggregation. tests/dispatch_stub.rs is rewritten to assert the real shape (200 + four sections, 400 on an unbounded range).

Per-appointment reminder dispatch is deferred: it needs a notifications handle on CalendarService plus a sent-reminder ledger (occurrences are virtual), tracked as a follow-up.

#PMS-58

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Merge remote-tracking branch 'origin/main' into feat/pms-58-calendar
All checks were successful
Check / fmt + clippy + compile + tests (pull_request) Successful in 1m43s
Build OCI container / Build and push mokosh-api image (push) Successful in 3m30s
0fd9124cc8
# Conflicts:
#	Cargo.lock
Merge branch 'main' into feat/pms-58-calendar
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 3m36s
Build OCI container / Build and push mokosh-api image (push) Successful in 7m10s
8874be8bca
vas2000-work deleted branch feat/pms-58-calendar 2026-06-05 04:24:47 +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!77
No description provided.