mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-10 05:12:14 +00:00
Wires the v1.4.18 expansion metrics into the gamification route. - Fetches `MoodEntry` rows alongside the existing measurement / intake / passkey / audit fetches so the mood badges have data. - Extends the audit-log query with `doctor-report.export` and `settings.locale.update` (the new hidden Easter-egg triggers). - Pushes the raw rows through `buildExpansionMetricValues` — mood streak / improvement, weight/BP/pulse counts, consistent-month, entry day-streak, weekend warrior, and the hidden trigger counts. - Computes `EarnabilityFlags` from the same numbers and applies `applyDiscoveryFilter` to the evaluated achievement list. Locked public badges that the user has *no path* to earn yet are filtered out; hidden Easter-eggs and already-unlocked badges always pass. - Recomputes the headline summary (`unlockedCount`, `totalCount`, `earnedPoints`, `totalPoints`, `nextAchievement`) from the visible set so the dashboard counters match the rendered list. The `nextAchievement` selector skips hidden cards so we never tease the user with a "next goal: ?" suggestion. The iOS format mock had to grow a `moodEntry.findMany` mock; that's a one-line pure-test change. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>