feat(analytics): replace health score with reference composite

This commit is contained in:
Marc-André Bombeck committed 2026-07-28 21:10:15 +02:00
1 parent 666a85d311
commit c91558f18f
87 files changed
+6033 -5868

No files matched your search

+10
View File
@@ -185,6 +185,16 @@ export function invalidateUserMedications(
caches.insightsTargets.deleteByPrefix(userId);
}
/**
* Hard-evict every server cache that can carry the derived Health Score.
* Lab, assessment and score-notice mutations call this one bundle so the
* analytics report, dashboard snapshot and derived batch cannot disagree.
*/
export function invalidateUserHealthScore(userId: string): void {
caches.analytics.deleteByPrefix(`${userId}|`);
caches.insightsDerived.deleteByPrefix(`${userId}|`);
}
/**
* v1.16.8 — invalidate every cache whose payload derives from the user's
* PROFILE-level settings rather than from measurement / mood / medication