fix(meds): grace-row save lands on the primary schedule

The detail page settings section PUTs reminderGraceMinutes at the
top level, but the schema only accepted it per-schedule, returning
422 on every save. The route now maps a top-level grace value onto
the primary schedule's reminderGraceMinutes before the Prisma
update; the schema declares the top-level field with a description
noting the normalisation.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Marc-André BombeckandClaude Opus 4.7 committed 2026-05-29 00:53:23 +02:00
1 parent 8c740fd146
commit 8adf1b55e8
4 files changed
+158

No files matched your search

+8
View File
@@ -1999,6 +1999,14 @@ components:
type: array
items:
$ref: "#/components/schemas/MedicationScheduleInput"
reminderGraceMinutes:
description: "Detail-page bridge: primary-schedule reminder-window in minutes. The route maps the value onto the primary
schedule's `reminderGraceMinutes` field; ignored when a full `schedules` array is also supplied."
anyOf:
- type: integer
minimum: 0
maximum: 1440
- type: "null"
description: Update-medication body. Every field is optional; omitted fields are left untouched. Supplying `schedules`
REPLACES the medication's full schedule list (the route deletes existing rows before re-creating). Flipping
`active` to false records the current timestamp on `pausedAt`; flipping back to true clears it. v1.5 invariants