fix(calendar): validate recurrence_rule as RFC 5545 on appointment create #264

Merged
nrupard merged 1 commit from fix/pms-374-validate-recurrence-rule into main 2026-06-16 20:49:45 +02:00
Owner

POST /api/v1/appointments stored recurrence_rule verbatim, so arbitrary text like "GARBAGE NOT A RULE" was persisted and only surfaced later as a skipped/errored series at expansion time. Extract the read-time expander's normalise-and-parse step into a shared parse_recurrence_rule helper and call it from create_appointment: a non-blank rule that fails to parse is rejected with a 422 field error (recurrence_rule) before any row is written, while valid RRULEs continue to be accepted and expand unchanged. Validation is anchored on the request's start_time so a rule accepted at write time is exactly one the expander can later walk. The update path is untouched because UpdateAppointmentRequest does not carry recurrence_rule.

#PMS-374

POST /api/v1/appointments stored recurrence_rule verbatim, so arbitrary text like "GARBAGE NOT A RULE" was persisted and only surfaced later as a skipped/errored series at expansion time. Extract the read-time expander's normalise-and-parse step into a shared parse_recurrence_rule helper and call it from create_appointment: a non-blank rule that fails to parse is rejected with a 422 field error (recurrence_rule) before any row is written, while valid RRULEs continue to be accepted and expand unchanged. Validation is anchored on the request's start_time so a rule accepted at write time is exactly one the expander can later walk. The update path is untouched because UpdateAppointmentRequest does not carry recurrence_rule. #PMS-374
fix(calendar): validate recurrence_rule as RFC 5545 on appointment create
All checks were successful
E2E / Playwright against staging (pull_request) Successful in 55s
Check / fmt + clippy + compile + unit/doc tests (pull_request) Successful in 1m10s
Integration / integration tests (pull_request) Successful in 3m8s
Create release / Create release from merged PR (pull_request) Has been skipped
7e04bbceb9
POST /api/v1/appointments stored recurrence_rule verbatim, so arbitrary text like "GARBAGE NOT A RULE" was persisted and only surfaced later as a skipped/errored series at expansion time. Extract the read-time expander's normalise-and-parse step into a shared parse_recurrence_rule helper and call it from create_appointment: a non-blank rule that fails to parse is rejected with a 422 field error (recurrence_rule) before any row is written, while valid RRULEs continue to be accepted and expand unchanged. Validation is anchored on the request's start_time so a rule accepted at write time is exactly one the expander can later walk. The update path is untouched because UpdateAppointmentRequest does not carry recurrence_rule.

#PMS-374
nrupard deleted branch fix/pms-374-validate-recurrence-rule 2026-06-16 20:49:45 +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!264
No description provided.