mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-08 12:32:43 +00:00
The four routes that bucket by Berlin calendar day (dashboard summary, medication intake, analytics correlations and sleep, insights targets) now read userTz from the authenticated User and pass it through userDayKey(). Streaks and consistency strips for a Pacific/Auckland user land on their Auckland-day, not the legacy Berlin-day. The aggregation logic is unchanged — only the bucket key function swaps from berlinDayKey(date) to userDayKey(date, userTz). Existing Berlin users see no behaviour change (Europe/Berlin is the schema default). Integration test extended with a two-case assertion: the userDayKey() boundary case (13:00 UTC May 14 → 2026-05-15 Auckland vs 2026-05-14 Berlin) and the dashboard summary route returning a non-zero streak for an Auckland account with three consecutive Auckland-day measurements.