mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-09 13:01:00 +00:00
A workout with `endedAt <= startedAt` produced a non-positive `durationSec` that downstream consumers treated as a real zero — worst case a fastest-5km PR of zero seconds, which would lock in until manual cleanup. Add a `.superRefine` clause on `createWorkoutSchema` so the ingest gate refuses the row. The PR detector stays defensive against any pre-gate row or future code path that bypasses the schema: MIN-direction slots now always filter `durationSec > 0` regardless of which field carries the PR value. A MIN slot sorts ascending, so the smallest value wins — a zero-duration row would always be picked first. Fix-M / code-M2.