mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-08 12:32:43 +00:00
Scans Measurement and Workout history per user and writes PersonalRecord rows for every all-time best. Direction comes from the W8d helper (MAX = higher wins, MIN = lower wins, null = never a PR). A seven-sample warm-up gate per metric keeps a one-off out-of-range sensor reading from locking in as the baseline. Workout slots cover longest run / longest distance / fastest 5 km for running and cycling. Ties write a row but mark it as push-suppressed so the user matched (not beat) their best. The unique index plus skipDuplicates makes the handler idempotent.