fix: harden reminder scheduler dedupe and boundary timing (#319)

* fix: harden reminder scheduler dedupe and boundary timing

* fix(ci): align medications route formatting with biome
This commit is contained in:
Daniel Volz
2026-02-25 22:15:35 +01:00
committed by GitHub
parent aa29d1c699
commit dbdf3b61cb
3 changed files with 179 additions and 130 deletions
+4 -4
View File
@@ -66,10 +66,10 @@ const medicationSchema = z
intakes: z.array(intakeSchema).min(1).max(12).optional(),
blisters: z.array(blisterSchema).min(1).max(12).optional(), // Legacy format
})
.refine(
(data) => (data.name && data.name.length > 0) || (data.genericName && data.genericName.length > 0),
{ message: "Either 'name' or 'genericName' must be provided", path: ["name"] }
)
.refine((data) => (data.name && data.name.length > 0) || (data.genericName && data.genericName.length > 0), {
message: "Either 'name' or 'genericName' must be provided",
path: ["name"],
})
.refine((data) => data.intakes || data.blisters, { message: "Either 'intakes' or 'blisters' must be provided" })
.refine(
(data) => {