fix(calendar): validate recurrence_rule as RFC 5545 on appointment create #264
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/pms-374-validate-recurrence-rule"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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