mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-08 12:32:43 +00:00
Adds the integration suite for the detection worker against a real Postgres testcontainer. Covers measurement-driven PRs (steps, RHR, VO2 max), idempotency on re-run, silent-flag propagation, and the drift guard that every PR-trackable metric type lands in the scan loop. Also patches a pre-existing schema gap: the (userId, metricType, metricSlot, achievedAt) unique index on personal_records is NULLS-DISTINCT in Postgres, so the index alone does not dedup the measurement-driven rows (metricSlot = NULL). The worker now does an application-level pre-flight findFirst on the same composite key before each insert, keeping both the workout path (index covers it) and the measurement path (application-level guard) idempotent without a Migration.