mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-08 12:32:43 +00:00
The cycle write path and the PR worker cast Prisma inputs to `never`, which switches off the compiler exactly where a schema/enum drift would otherwise be caught. - day-log-write: `ExistingRow` and `SensitiveFields` widened every enum column to `string`, forcing 21 `as never` writes. Type them to the generated enums (FlowLevel, OvulationTest, CervicalMucus, Cervix*, HomeTestResult, ContraceptiveKind) — the Zod input enums already match member-for-member — and build the create row from the typed locals instead of re-casting the update-input shape. - cycle/backup: thread the enum element type through `enumOrNull` and pin each allow-set to its enum, so the 12 restore writes type-check against the generated create input rather than `never`. - pr-detection-worker: type the candidate `source` as MeasurementSource (both Workout and PersonalRecord use it) and give `findBestWorkout` a real `Prisma.WorkoutWhereInput` + `WorkoutOrderByWithRelationInput`. No behaviour change; the writes are now compiler-checked. No latent drift surfaced — every enum set lines up with the schema.