fix(gamification): exclude soft-deleted measurements in achievement queries

v1.4.41 W-DELETED-2 — achievement progress now scopes the measurement
read to deletedAt: null so deleting a row immediately rolls back any
streak or count badge it had earned, matching the analytics + dashboard
sweeps from v1.4.40.
This commit is contained in:
Marc-André Bombeck committed 2026-05-21 17:13:07 +02:00
1 parent 5296a6122f
commit cb8f74e4fa
1 file changed
+4
@@ -536,6 +536,10 @@ async function buildAchievementsResult(user: AuthedUser) {
type: {
in: ["WEIGHT", "BLOOD_PRESSURE_SYS", "BLOOD_PRESSURE_DIA", "PULSE"],
},
// v1.4.41 W-DELETED-2 — soft-deleted measurements are excluded
// from achievement progress so deleting a row immediately rolls
// back any streak / count badge it earned.
deletedAt: null,
},
select: {
type: true,