feat(notifications): MEASUREMENT_REMINDER event type and client-managed gate

Register the MEASUREMENT_REMINDER event type (default on at the channel
layer; the real gate is the per-reminder enabled flag) and add the
notificationPrefs.measurementReminder.clientManaged sub-object plus its
cron-side resolver, mirroring the medication and cycle client-managed
precedent. The event rides the generic APNs category path and stays
non-time-sensitive, so it delivers as a plain banner with no client
change.
This commit is contained in:
Marc-André Bombeck committed 2026-06-14 23:33:30 +02:00
1 parent 383963d3b4
commit 8058d81590
4 files changed
+152

No files matched your search

@@ -103,6 +103,9 @@ describe("GET /api/auth/me/notification-prefs", () => {
nudgeRoutine: true,
nudgeFrequency: "weekly",
},
measurementReminder: {
clientManaged: false,
},
});
});
@@ -135,6 +138,9 @@ describe("GET /api/auth/me/notification-prefs", () => {
nudgeRoutine: true,
nudgeFrequency: "weekly",
},
measurementReminder: {
clientManaged: false,
},
});
});
@@ -169,6 +175,9 @@ describe("GET /api/auth/me/notification-prefs", () => {
nudgeRoutine: true,
nudgeFrequency: "weekly",
},
measurementReminder: {
clientManaged: false,
},
});
});
});
@@ -214,6 +223,9 @@ describe("PATCH /api/auth/me/notification-prefs", () => {
nudgeRoutine: true,
nudgeFrequency: "weekly",
},
measurementReminder: {
clientManaged: false,
},
});
expect(prisma.user.update).toHaveBeenCalledWith({
@@ -235,6 +247,9 @@ describe("PATCH /api/auth/me/notification-prefs", () => {
nudgeRoutine: true,
nudgeFrequency: "weekly",
},
measurementReminder: {
clientManaged: false,
},
},
},
});
@@ -260,6 +275,9 @@ describe("PATCH /api/auth/me/notification-prefs", () => {
nudgeRoutine: true,
nudgeFrequency: "weekly",
},
measurementReminder: {
clientManaged: false,
},
},
next: {
medication: {
@@ -277,6 +295,9 @@ describe("PATCH /api/auth/me/notification-prefs", () => {
nudgeRoutine: true,
nudgeFrequency: "weekly",
},
measurementReminder: {
clientManaged: false,
},
},
changed: ["medication"],
}),
@@ -347,6 +368,9 @@ describe("PATCH /api/auth/me/notification-prefs", () => {
nudgeRoutine: true,
nudgeFrequency: "weekly",
},
measurementReminder: {
clientManaged: false,
},
},
},
});
@@ -382,6 +406,9 @@ describe("PATCH /api/auth/me/notification-prefs", () => {
nudgeRoutine: true,
nudgeFrequency: "weekly",
},
measurementReminder: {
clientManaged: false,
},
});
expect(prisma.user.update).toHaveBeenCalledWith({
@@ -403,6 +430,9 @@ describe("PATCH /api/auth/me/notification-prefs", () => {
nudgeRoutine: true,
nudgeFrequency: "weekly",
},
measurementReminder: {
clientManaged: false,
},
},
},
});
@@ -443,6 +473,9 @@ describe("PATCH /api/auth/me/notification-prefs", () => {
nudgeRoutine: true,
nudgeFrequency: "weekly",
},
measurementReminder: {
clientManaged: false,
},
},
},
});