mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-08 20:42:43 +00:00
Two trigger fixes so the new achievements actually fire end-to-end. The doctor-PDF hidden Easter-egg used to watch a non-existent `doctor-report.export` audit action. The real route emits two: `doctor-report.generate` (the JSON helper) and `doctor-report.pdf.generate` (the PDF route). Either now counts. The locale-flip hidden Easter-egg used to watch `settings.locale.update`, which no endpoint emits — the locale field shares the catch-all `profile.update` audit row with every other profile field. Profile-update now emits a separate `settings.locale.update` row when (and only when) the locale value actually changes (compares the new value to the prior persisted locale, suppresses the row when they match), with the from/to values in the details payload for traceability. Already-existing TanStack Query invalidation map covers the new metrics: `measurementDependentKeys`, `moodDependentKeys`, and `medicationDependentKeys` already include `queryKeys.gamificationAchievements()`, so any measurement / mood / intake mutation triggers a refetch and the route persists the new unlock to `UserAchievement` (existing v1.4.15 mechanism). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>