mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-14 06:40:50 +00:00
Push range-aware aggregation into Postgres via `date_trunc` so the bucket cap applies AFTER bucketising, not before. A 1-year `aggregate=daily` request on a minute-by-minute pulse account now walks every row in the window and returns up to 365 daily buckets instead of silently truncating to the first N raw rows. Gate the aggregation branch on an explicit `aggregate` query param. Callers that pass `from`/`to` without `aggregate` (the iOS path) keep the raw `MeasurementWireDTO` wire shape — the v1.5 locked contract stays byte-stable. The new `monthly` grain bounds multi-year "All time" charts at 24 buckets per type.