diff --git a/src/app/api/medications/[id]/__tests__/route.test.ts b/src/app/api/medications/[id]/__tests__/route.test.ts index 8cc13470d..a1791b827 100644 --- a/src/app/api/medications/[id]/__tests__/route.test.ts +++ b/src/app/api/medications/[id]/__tests__/route.test.ts @@ -41,6 +41,39 @@ vi.mock("@/lib/db", () => ({ }, })); +// The answer is the medication's read model (`medicationDetail`), whose +// reads and resolution the integration walks hold against the contract. +// Here it stands in with the part these tests read: the written row with +// its schedules wired as every medication answer wires them. +vi.mock("@/lib/medications/read-medication", async (importOriginal) => { + const actual = + await importOriginal(); + const { scheduleWireFields } = + await import("@/lib/medications/intake-tracking"); + const { serializeScheduleUnitsPerDose } = + await import("@/lib/medications/schedule-units-dto"); + return { + ...actual, + medicationDetail: vi.fn( + async ({ + medication, + }: { + medication: Parameters[0]["medication"]; + }) => ({ + ...medication, + unitsPerDose: Number(medication.unitsPerDose), + ...scheduleWireFields( + medication.trackIntake, + serializeScheduleUnitsPerDose( + medication.schedules, + medication.unitsPerDose, + ), + ), + }), + ), + }; +}); + vi.mock("@/lib/auth/session", () => ({ getSession: vi.fn() })); vi.mock("@/lib/auth/audit", () => ({ auditLog: vi.fn().mockResolvedValue(undefined), diff --git a/src/app/api/medications/__tests__/route.test.ts b/src/app/api/medications/__tests__/route.test.ts index d91bb73e9..1159f63a2 100644 --- a/src/app/api/medications/__tests__/route.test.ts +++ b/src/app/api/medications/__tests__/route.test.ts @@ -34,6 +34,39 @@ vi.mock("@/lib/db", () => ({ }, })); +// The answer is the medication's read model (`medicationDetail`), whose +// reads and resolution the integration walks hold against the contract. +// Here it stands in with the part these tests read: the written row with +// its schedules wired as every medication answer wires them. +vi.mock("@/lib/medications/read-medication", async (importOriginal) => { + const actual = + await importOriginal(); + const { scheduleWireFields } = + await import("@/lib/medications/intake-tracking"); + const { serializeScheduleUnitsPerDose } = + await import("@/lib/medications/schedule-units-dto"); + return { + ...actual, + medicationDetail: vi.fn( + async ({ + medication, + }: { + medication: Parameters[0]["medication"]; + }) => ({ + ...medication, + unitsPerDose: Number(medication.unitsPerDose), + ...scheduleWireFields( + medication.trackIntake, + serializeScheduleUnitsPerDose( + medication.schedules, + medication.unitsPerDose, + ), + ), + }), + ), + }; +}); + vi.mock("@/lib/auth/session", () => ({ getSession: vi.fn() })); vi.mock("@/lib/auth/audit", () => ({ auditLog: vi.fn().mockResolvedValue(undefined), @@ -88,6 +121,7 @@ vi.mock("next/headers", () => ({ import { GET, POST } from "../route"; import { prisma } from "@/lib/db"; +import { medicationDetail } from "@/lib/medications/read-medication"; import { getSession } from "@/lib/auth/session"; import { cachedSwr } from "@/lib/cache/server-cache"; import { getUserTodayBounds } from "@/lib/tz/local-day"; @@ -657,11 +691,18 @@ describe("POST /api/medications — Apple Health mirror (v1.28)", () => { const res = await POST(postReq(MIRROR_BODY)); expect(res.status).toBe(200); const body = (await res.json()) as { - data: { id: string; externalId: string; category: string }; + data: { id: string; externalId: string }; }; expect(body.data.id).toBe("med-existing"); expect(body.data.externalId).toBe("hk-concept-1"); - expect(body.data.category).toBe("OTHER"); + // Answered with the read model of the stored row, keeping the create's + // action on the event. + expect(medicationDetail).toHaveBeenCalledWith( + expect.objectContaining({ + medication: expect.objectContaining({ id: "med-existing" }), + announce: false, + }), + ); // Idempotent replay: nothing written. expect(prisma.medication.create).not.toHaveBeenCalled(); }); diff --git a/src/lib/medications/create-medication.ts b/src/lib/medications/create-medication.ts index 4b9a370de..11162bfe6 100644 --- a/src/lib/medications/create-medication.ts +++ b/src/lib/medications/create-medication.ts @@ -10,33 +10,27 @@ import type { z } from "zod/v4"; import { prisma } from "@/lib/db"; -import type { Prisma } from "@/generated/prisma/client"; -import { annotate, getEvent } from "@/lib/logging/context"; +import { annotate } from "@/lib/logging/context"; import { auditLog } from "@/lib/auth/audit"; -import type { SessionUser } from "@/lib/auth/session-user"; -import { - courseRefusalResponse, - resolveCourseFields, -} from "@/lib/medications/courses"; +import { courseRefusalResponse } from "@/lib/medications/courses"; import { dateOfDayKey, dayKeyOfDate, validateCourses, } from "@/lib/medications/course-window"; import { DEFAULT_TIMEZONE, userDayKey } from "@/lib/tz/format"; -import { - isCustomMedicationCategoryKey, - type createMedicationSchema, -} from "@/lib/validations/medication"; +import type { createMedicationSchema } from "@/lib/validations/medication"; import { isAssignableCategory, - resolveMedicationCategories, setMedicationCategory, } from "@/lib/medication-category"; import { serializeScheduleRecurrence } from "@/lib/medication-schedule"; import { invalidateUserMedications } from "@/lib/cache/invalidate"; -import { serializeScheduleUnitsPerDose } from "@/lib/medications/schedule-units-dto"; -import { scheduleWireFields } from "@/lib/medications/intake-tracking"; +import type { Medication, MedicationSchedule } from "@/generated/prisma/client"; +import { + medicationDetail, + type ReadUser, +} from "@/lib/medications/read-medication"; export type CreateMedicationInput = z.output; type ScheduleInput = NonNullable[number]; @@ -67,28 +61,14 @@ export type CreateMedicationOutcome = * EXISTING row (status 200, vs 201 for a fresh create) when the caller * re-posts a `(externalSource, externalId)` pair this user already mirrors — * the iOS re-sync replays its full HealthKit medication list, and a replay - * must neither duplicate nor 500. Response shape mirrors the fresh-create - * envelope (schedules included, category joined, Decimal unwrapped); no - * audit row and no cache eviction because nothing was written. + * must neither duplicate nor 500. It answers the medication's read model, + * the same body the fresh create and the detail read answer; no audit row + * and no cache eviction because nothing was written. */ async function existingMirrorBody( - medication: Record & { - id: string; - unitsPerDose: unknown; - trackIntake: boolean; - schedules: Array<{ unitsPerDose: Prisma.Decimal | null }>; - }, + user: ReadUser, + medication: Medication & { schedules: MedicationSchedule[] }, ): Promise { - let category = "OTHER"; - let categoryLabel: string | null = null; - try { - const categories = await resolveMedicationCategories([medication.id]); - category = categories[medication.id]?.category ?? "OTHER"; - categoryLabel = categories[medication.id]?.categoryLabel ?? null; - } catch { - getEvent()?.addWarning("Medication categories could not be loaded"); - } - annotate({ action: { name: "medication.create", @@ -97,25 +77,14 @@ async function existingMirrorBody( }, meta: { idempotent_replay: true }, }); - - return { - kind: "existing", - body: { - ...medication, - unitsPerDose: Number(medication.unitsPerDose), - // #219 — Decimal → number for the per-schedule column too. - // (#1033) — record-only medications ship `schedules: []`. - ...scheduleWireFields( - medication.trackIntake, - serializeScheduleUnitsPerDose( - medication.schedules, - Number(medication.unitsPerDose), - ), - ), - category, - categoryLabel, - }, - }; + // The read model, exactly as `GET /api/medications/{id}` answers it. + const body = await medicationDetail({ + user, + grantId: null, + medication, + announce: false, + }); + return { kind: "existing", body }; } /** @@ -127,16 +96,17 @@ async function existingMirrorBody( * create covers the concurrent race. Null when the create goes ahead. */ async function existingMirrorOrCap( - userId: string, + user: ReadUser, externalSource: NonNullable, externalId: string, ): Promise { + const userId = user.id; const existing = await prisma.medication.findFirst({ where: { userId, externalSource, externalId }, include: { schedules: true }, }); if (existing) { - return existingMirrorBody(existing); + return existingMirrorBody(user, existing); } // Growth guard. This point is only reached when the idempotency lookup @@ -438,7 +408,7 @@ function insertMedication( } export async function createMedication(input: { - user: Pick; + user: ReadUser; data: CreateMedicationInput; ipAddress: string | null; }): Promise { @@ -468,11 +438,7 @@ export async function createMedication(input: { } if (externalSource !== undefined && externalId !== undefined) { - const mirror = await existingMirrorOrCap( - user.id, - externalSource, - externalId, - ); + const mirror = await existingMirrorOrCap(user, externalSource, externalId); if (mirror) return mirror; } @@ -516,19 +482,12 @@ export async function createMedication(input: { where: { userId: user.id, externalSource, externalId }, include: { schedules: true }, }); - if (winner) return existingMirrorBody(winner); + if (winner) return existingMirrorBody(user, winner); } throw err; } - const normalizedCategory = await setMedicationCategory( - medication.id, - category, - ); - const categoryLabel = isCustomMedicationCategoryKey(normalizedCategory) - ? ((await resolveMedicationCategories([medication.id]))[medication.id] - ?.categoryLabel ?? null) - : null; + await setMedicationCategory(medication.id, category); await auditLog("medication.create", { userId: user.id, @@ -554,30 +513,12 @@ export async function createMedication(input: { // read reflects the new schedule. invalidateUserMedications(user.id, { evict: true }); - return { - kind: "created", - body: { - ...medication, - unitsPerDose: Number(medication.unitsPerDose), - // #219 — Decimal → number for the per-schedule column too. - // (#1033) — record-only medications ship `schedules: []`. - ...scheduleWireFields( - medication.trackIntake, - serializeScheduleUnitsPerDose( - medication.schedules, - medication.unitsPerDose, - ), - ), - category: normalizedCategory, - categoryLabel, - // (#1024) — the courses, as every medication read carries them. - ...( - await resolveCourseFields( - [medication], - new Date(), - user.timezone || DEFAULT_TIMEZONE, - ) - ).get(medication.id), - }, - }; + // The read model, exactly as `GET /api/medications/{id}` answers it. + const body = await medicationDetail({ + user, + grantId: null, + medication, + announce: false, + }); + return { kind: "created", body }; } diff --git a/src/lib/medications/read-medication.ts b/src/lib/medications/read-medication.ts index 9b1c02f85..248235e3e 100644 --- a/src/lib/medications/read-medication.ts +++ b/src/lib/medications/read-medication.ts @@ -36,7 +36,7 @@ import { resolveIntakeActionability } from "@/lib/medications/intake-actionable" import { DEFAULT_TIMEZONE } from "@/lib/tz/format"; import { buildRelated } from "@/lib/links/related"; -type ReadUser = Pick; +export type ReadUser = Pick; type MedicationWithSchedules = Medication & { schedules: MedicationSchedule[]; }; @@ -195,6 +195,26 @@ export async function readMedication(input: { if (!medication || medication.userId !== user.id) { return null; } + return medicationDetail({ user, grantId, medication, announce: true }); +} + +/** + * The read model of a medication row in hand: the detail answer, and the + * answer of a create or an edit, which pass the row they just wrote so they + * answer exactly what `GET /api/medications/{id}` would. + */ +export async function medicationDetail(input: { + user: ReadUser; + grantId: string | null; + medication: MedicationWithSchedules; + /** + * Name the request's action `medication.get`. A write answering with the + * read model passes false and keeps its own action. + */ + announce: boolean; +}): Promise> { + const { user, grantId, medication } = input; + const id = medication.id; let category = "OTHER"; let categoryLabel: string | null = null; @@ -208,13 +228,15 @@ export async function readMedication(input: { const { display, userTz, now } = await loadDisplayDue(user, id, medication); - annotate({ - action: { - name: "medication.get", - entity_type: "medication", - entity_id: id, - }, - }); + if (input.announce) { + annotate({ + action: { + name: "medication.get", + entity_type: "medication", + entity_id: id, + }, + }); + } const { schedulesDto, stockUnitsRemaining, stockDosesRemaining, runwayDays } = await loadStock(user, id, medication); diff --git a/src/lib/medications/scheduling/__tests__/apply-canonical-slot-write.test.ts b/src/lib/medications/scheduling/__tests__/apply-canonical-slot-write.test.ts index abfd20310..e08399a02 100644 --- a/src/lib/medications/scheduling/__tests__/apply-canonical-slot-write.test.ts +++ b/src/lib/medications/scheduling/__tests__/apply-canonical-slot-write.test.ts @@ -18,14 +18,27 @@ import { applyCanonicalSlotWrite, type SlotIntakeRow } from "../slot-upsert"; const SLOT = new Date("2026-06-15T05:00:00.000Z"); function row(overrides: Partial = {}): SlotIntakeRow { + const createdAt = new Date("2026-06-15T00:00:00.000Z"); return { id: "row-1", + userId: "user-1", + medicationId: "med-1", takenAt: null, skipped: false, + autoMissed: false, + autoRecorded: false, + attributionSource: "AUTO", idempotencyKey: null, scheduledFor: SLOT, source: "REMINDER", - createdAt: new Date("2026-06-15T00:00:00.000Z"), + createdAt, + injectionSite: null, + doseTaken: null, + inventoryConsumption: null, + externalId: null, + updatedAt: createdAt, + syncVersion: 0, + deletedAt: null, ...overrides, }; } diff --git a/src/lib/medications/scheduling/slot-upsert.ts b/src/lib/medications/scheduling/slot-upsert.ts index 69faf5844..13a791050 100644 --- a/src/lib/medications/scheduling/slot-upsert.ts +++ b/src/lib/medications/scheduling/slot-upsert.ts @@ -14,7 +14,10 @@ * (PRN / off-slot beyond tolerance / cyclic off-week / no schedules) — * the caller's signal to keep the unmodified insert behaviour. */ -import type { PrismaClient } from "@/generated/prisma/client"; +import type { + MedicationIntakeEvent, + PrismaClient, +} from "@/generated/prisma/client"; import { prisma as defaultPrisma } from "@/lib/db"; import { isP2002 } from "@/lib/prisma-errors"; @@ -30,16 +33,12 @@ import type { InjectionSiteKey } from "@/lib/medications/injection-sites"; type PrismaLike = Pick; -/** The minimal intake-row shape the slot upsert reads + returns. */ -export interface SlotIntakeRow { - id: string; - takenAt: Date | null; - skipped: boolean; - idempotencyKey: string | null; - scheduledFor: Date; - source: string; - createdAt: Date; -} +/** + * The intake row the slot upsert reads and returns: the whole row, so a + * write that converged onto a slot answers the same event shape as one that + * inserted its own (the declared `MedicationIntakeEvent`). + */ +export type SlotIntakeRow = MedicationIntakeEvent; export interface ApplyCanonicalSlotWriteInput { client: PrismaLike; @@ -151,16 +150,6 @@ export interface ApplyCanonicalSlotWriteResult { outcomeChangeRefused: boolean; } -const SLOT_ROW_SELECT = { - id: true, - takenAt: true, - skipped: true, - idempotencyKey: true, - scheduledFor: true, - source: true, - createdAt: true, -} as const; - /** * Forward grace a TAKEN write may still snap onto a slot whose anchor sits * ahead of the take — the same clock-skew / early-dose margin the resolver's @@ -239,7 +228,6 @@ async function findSlotRows( scheduledFor: canonicalSlot, deletedAt: null, }, - select: SLOT_ROW_SELECT, // H1 — deterministic order; actioned-preference applied in // `pickSlotRow`. orderBy: [{ createdAt: "asc" }, { id: "asc" }], @@ -311,7 +299,6 @@ export async function applyCanonicalSlotWrite( // v1.28 — external dose-event id only when the write carries one. ...(externalId !== null && { externalId }), }, - select: SLOT_ROW_SELECT, })) as SlotIntakeRow; return { row: created, @@ -453,7 +440,6 @@ async function applyToExisting( // never clears a previously-recorded id. ...(externalId !== null && { externalId }), }, - select: SLOT_ROW_SELECT, })) as SlotIntakeRow; return { diff --git a/src/lib/medications/update-medication/update-medication.ts b/src/lib/medications/update-medication/update-medication.ts index be7c9ba20..b698fb894 100644 --- a/src/lib/medications/update-medication/update-medication.ts +++ b/src/lib/medications/update-medication/update-medication.ts @@ -7,6 +7,10 @@ * everything after it run here, in the order they always ran. The outcome is * a refusal the route answers with `apiError`, or the edited medication. */ +import { + medicationDetail, + type ReadUser, +} from "@/lib/medications/read-medication"; import { prisma } from "@/lib/db"; import { enqueueSupplementNutrientRecompute, @@ -14,7 +18,6 @@ import { } from "@/lib/medications/ingredients/recompute-job"; import { annotate } from "@/lib/logging/context"; import { auditLog } from "@/lib/auth/audit"; -import type { SessionUser } from "@/lib/auth/session-user"; import { overwriteDetails } from "@/lib/sharing/audit-details"; import { invalidateUserMedications } from "@/lib/cache/invalidate"; import { @@ -25,11 +28,8 @@ import { import { CourseWriteError, courseRefusalResponse, - resolveCourseFields, } from "@/lib/medications/courses"; import { refreshDoseDay } from "@/lib/medications/dose-day-refresh"; -import { serializeScheduleUnitsPerDose } from "@/lib/medications/schedule-units-dto"; -import { scheduleWireFields } from "@/lib/medications/intake-tracking"; import { DEFAULT_TIMEZONE } from "@/lib/tz/format"; import { applyRecordOnlyRule, @@ -49,7 +49,7 @@ import { type MedicationEditWrite, } from "./write"; -type EditUser = Pick; +type EditUser = ReadUser; type EditedMedication = Awaited>; export type MedicationEditOutcome = @@ -238,7 +238,6 @@ async function writeCategory( } if (categoryToWrite !== undefined) await setMedicationCategory(id, categoryToWrite); - return (await resolveMedicationCategories([id]))[id]; } /** The audit row: C4 on the medication row itself, C7 on the schedule. */ @@ -336,12 +335,7 @@ export async function updateMedication(input: { plan.primaryScheduleGracePatch, ); - const resolvedCategory = await writeCategory( - id, - write.input.category, - input.authMethod, - ); - const normalizedCategory = resolvedCategory?.category ?? "OTHER"; + await writeCategory(id, write.input.category, input.authMethod); // A changed units-per-dose (on the medication or on a slot) changes what // every taken dose added, so a medication with a composition has its doses @@ -364,24 +358,12 @@ export async function updateMedication(input: { // read reflects the schedule change. invalidateUserMedications(user.id, { evict: true }); - return { - ok: true, - body: { - ...medication, - unitsPerDose: Number(medication.unitsPerDose), - ...scheduleWireFields( - medication.trackIntake, - serializeScheduleUnitsPerDose( - medication.schedules, - medication.unitsPerDose, - ), - ), - category: normalizedCategory, - categoryLabel: resolvedCategory?.categoryLabel ?? null, - // The courses, as every medication read carries them (#1024). - ...( - await resolveCourseFields([medication], new Date(), write.courseTz) - ).get(id), - }, - }; + // The read model, exactly as `GET /api/medications/{id}` answers it. + const body = await medicationDetail({ + user, + grantId: null, + medication, + announce: false, + }); + return { ok: true, body }; } diff --git a/tests/integration/routes/parity/__snapshots__/medication-detail.11-plain-fields.json.snap b/tests/integration/routes/parity/__snapshots__/medication-detail.11-plain-fields.json.snap index caac60735..a51c9f9c7 100644 --- a/tests/integration/routes/parity/__snapshots__/medication-detail.11-plain-fields.json.snap +++ b/tests/integration/routes/parity/__snapshots__/medication-detail.11-plain-fields.json.snap @@ -83,7 +83,17 @@ "courses": [], "courseCount": 0, "previousCourseEndedOn": null, - "canStartCourse": false + "canStartCourse": false, + "nextDueAt": "2026-10-15T18:00:00.000Z", + "remindersActive": false, + "nextDueOverdue": false, + "courseStatus": "CURRENT", + "intakeActionable": true, + "stockUnitsRemaining": null, + "stockDosesRemaining": null, + "runwayDays": null, + "ingredients": [], + "related": [] }, "error": null }, diff --git a/tests/integration/routes/parity/__snapshots__/medication-detail.12-schedule-replace.json.snap b/tests/integration/routes/parity/__snapshots__/medication-detail.12-schedule-replace.json.snap index 9253f75d6..633798338 100644 --- a/tests/integration/routes/parity/__snapshots__/medication-detail.12-schedule-replace.json.snap +++ b/tests/integration/routes/parity/__snapshots__/medication-detail.12-schedule-replace.json.snap @@ -89,7 +89,17 @@ "courses": [], "courseCount": 0, "previousCourseEndedOn": null, - "canStartCourse": false + "canStartCourse": false, + "nextDueAt": "2026-10-16T09:30:00.000Z", + "remindersActive": false, + "nextDueOverdue": false, + "courseStatus": "CURRENT", + "intakeActionable": true, + "stockUnitsRemaining": null, + "stockDosesRemaining": null, + "runwayDays": null, + "ingredients": [], + "related": [] }, "error": null }, diff --git a/tests/integration/routes/parity/__snapshots__/medication-detail.13-schedule-echo.json.snap b/tests/integration/routes/parity/__snapshots__/medication-detail.13-schedule-echo.json.snap index 76cbe084b..798ac25e4 100644 --- a/tests/integration/routes/parity/__snapshots__/medication-detail.13-schedule-echo.json.snap +++ b/tests/integration/routes/parity/__snapshots__/medication-detail.13-schedule-echo.json.snap @@ -89,7 +89,17 @@ "courses": [], "courseCount": 0, "previousCourseEndedOn": null, - "canStartCourse": false + "canStartCourse": false, + "nextDueAt": "2026-10-16T09:30:00.000Z", + "remindersActive": false, + "nextDueOverdue": false, + "courseStatus": "CURRENT", + "intakeActionable": true, + "stockUnitsRemaining": null, + "stockDosesRemaining": null, + "runwayDays": null, + "ingredients": [], + "related": [] }, "error": null }, diff --git a/tests/integration/routes/parity/__snapshots__/medication-detail.14-grace-bridge.json.snap b/tests/integration/routes/parity/__snapshots__/medication-detail.14-grace-bridge.json.snap index 9592315ae..b2c594dfe 100644 --- a/tests/integration/routes/parity/__snapshots__/medication-detail.14-grace-bridge.json.snap +++ b/tests/integration/routes/parity/__snapshots__/medication-detail.14-grace-bridge.json.snap @@ -89,7 +89,17 @@ "courses": [], "courseCount": 0, "previousCourseEndedOn": null, - "canStartCourse": false + "canStartCourse": false, + "nextDueAt": "2026-10-16T09:30:00.000Z", + "remindersActive": false, + "nextDueOverdue": false, + "courseStatus": "CURRENT", + "intakeActionable": true, + "stockUnitsRemaining": null, + "stockDosesRemaining": null, + "runwayDays": null, + "ingredients": [], + "related": [] }, "error": null }, diff --git a/tests/integration/routes/parity/__snapshots__/medication-detail.15a-pause.json.snap b/tests/integration/routes/parity/__snapshots__/medication-detail.15a-pause.json.snap index 58c4631c6..341c62676 100644 --- a/tests/integration/routes/parity/__snapshots__/medication-detail.15a-pause.json.snap +++ b/tests/integration/routes/parity/__snapshots__/medication-detail.15a-pause.json.snap @@ -89,7 +89,17 @@ "courses": [], "courseCount": 0, "previousCourseEndedOn": null, - "canStartCourse": false + "canStartCourse": false, + "nextDueAt": "2026-10-16T09:30:00.000Z", + "remindersActive": false, + "nextDueOverdue": false, + "courseStatus": "CURRENT", + "intakeActionable": false, + "stockUnitsRemaining": null, + "stockDosesRemaining": null, + "runwayDays": null, + "ingredients": [], + "related": [] }, "error": null }, diff --git a/tests/integration/routes/parity/__snapshots__/medication-detail.15b-resume.json.snap b/tests/integration/routes/parity/__snapshots__/medication-detail.15b-resume.json.snap index 80d5f956d..eb29dbaf6 100644 --- a/tests/integration/routes/parity/__snapshots__/medication-detail.15b-resume.json.snap +++ b/tests/integration/routes/parity/__snapshots__/medication-detail.15b-resume.json.snap @@ -89,7 +89,17 @@ "courses": [], "courseCount": 0, "previousCourseEndedOn": null, - "canStartCourse": false + "canStartCourse": false, + "nextDueAt": "2026-10-16T09:30:00.000Z", + "remindersActive": false, + "nextDueOverdue": false, + "courseStatus": "CURRENT", + "intakeActionable": true, + "stockUnitsRemaining": null, + "stockDosesRemaining": null, + "runwayDays": null, + "ingredients": [], + "related": [] }, "error": null }, diff --git a/tests/integration/routes/parity/__snapshots__/medication-detail.16-auto-mark-taken.json.snap b/tests/integration/routes/parity/__snapshots__/medication-detail.16-auto-mark-taken.json.snap index f960f6d45..d9b77b14f 100644 --- a/tests/integration/routes/parity/__snapshots__/medication-detail.16-auto-mark-taken.json.snap +++ b/tests/integration/routes/parity/__snapshots__/medication-detail.16-auto-mark-taken.json.snap @@ -89,7 +89,17 @@ "courses": [], "courseCount": 0, "previousCourseEndedOn": null, - "canStartCourse": false + "canStartCourse": false, + "nextDueAt": "2026-10-16T09:30:00.000Z", + "remindersActive": false, + "nextDueOverdue": false, + "courseStatus": "CURRENT", + "intakeActionable": true, + "stockUnitsRemaining": null, + "stockDosesRemaining": null, + "runwayDays": null, + "ingredients": [], + "related": [] }, "error": null }, diff --git a/tests/integration/routes/parity/__snapshots__/medication-detail.17a-custom-category.json.snap b/tests/integration/routes/parity/__snapshots__/medication-detail.17a-custom-category.json.snap index 41c112d3d..1aff35567 100644 --- a/tests/integration/routes/parity/__snapshots__/medication-detail.17a-custom-category.json.snap +++ b/tests/integration/routes/parity/__snapshots__/medication-detail.17a-custom-category.json.snap @@ -89,7 +89,17 @@ "courses": [], "courseCount": 0, "previousCourseEndedOn": null, - "canStartCourse": false + "canStartCourse": false, + "nextDueAt": "2026-10-16T09:30:00.000Z", + "remindersActive": false, + "nextDueOverdue": false, + "courseStatus": "CURRENT", + "intakeActionable": true, + "stockUnitsRemaining": null, + "stockDosesRemaining": null, + "runwayDays": null, + "ingredients": [], + "related": [] }, "error": null }, diff --git a/tests/integration/routes/parity/__snapshots__/medication-detail.17b-native-other-kept.json.snap b/tests/integration/routes/parity/__snapshots__/medication-detail.17b-native-other-kept.json.snap index e537872e2..d6d69d3b3 100644 --- a/tests/integration/routes/parity/__snapshots__/medication-detail.17b-native-other-kept.json.snap +++ b/tests/integration/routes/parity/__snapshots__/medication-detail.17b-native-other-kept.json.snap @@ -89,7 +89,17 @@ "courses": [], "courseCount": 0, "previousCourseEndedOn": null, - "canStartCourse": false + "canStartCourse": false, + "nextDueAt": "2026-10-16T09:30:00.000Z", + "remindersActive": false, + "nextDueOverdue": false, + "courseStatus": "CURRENT", + "intakeActionable": true, + "stockUnitsRemaining": null, + "stockDosesRemaining": null, + "runwayDays": null, + "ingredients": [], + "related": [] }, "error": null }, diff --git a/tests/integration/routes/parity/__snapshots__/medication-detail.17c-web-other.json.snap b/tests/integration/routes/parity/__snapshots__/medication-detail.17c-web-other.json.snap index aa42bd9a1..8298a4f74 100644 --- a/tests/integration/routes/parity/__snapshots__/medication-detail.17c-web-other.json.snap +++ b/tests/integration/routes/parity/__snapshots__/medication-detail.17c-web-other.json.snap @@ -89,7 +89,17 @@ "courses": [], "courseCount": 0, "previousCourseEndedOn": null, - "canStartCourse": false + "canStartCourse": false, + "nextDueAt": "2026-10-16T09:30:00.000Z", + "remindersActive": false, + "nextDueOverdue": false, + "courseStatus": "CURRENT", + "intakeActionable": true, + "stockUnitsRemaining": null, + "stockDosesRemaining": null, + "runwayDays": null, + "ingredients": [], + "related": [] }, "error": null }, diff --git a/tests/integration/routes/parity/__snapshots__/medication-detail.18a-record-schedule-kept.json.snap b/tests/integration/routes/parity/__snapshots__/medication-detail.18a-record-schedule-kept.json.snap index 812cf0903..b8c24ee3e 100644 --- a/tests/integration/routes/parity/__snapshots__/medication-detail.18a-record-schedule-kept.json.snap +++ b/tests/integration/routes/parity/__snapshots__/medication-detail.18a-record-schedule-kept.json.snap @@ -63,7 +63,17 @@ "courses": [], "courseCount": 0, "previousCourseEndedOn": null, - "canStartCourse": false + "canStartCourse": false, + "nextDueAt": null, + "remindersActive": false, + "nextDueOverdue": false, + "courseStatus": "CURRENT", + "intakeActionable": false, + "stockUnitsRemaining": null, + "stockDosesRemaining": null, + "runwayDays": null, + "ingredients": [], + "related": [] }, "error": null }, diff --git a/tests/integration/routes/parity/__snapshots__/medication-detail.18b-tracking-on.json.snap b/tests/integration/routes/parity/__snapshots__/medication-detail.18b-tracking-on.json.snap index 152c79133..fb5603aae 100644 --- a/tests/integration/routes/parity/__snapshots__/medication-detail.18b-tracking-on.json.snap +++ b/tests/integration/routes/parity/__snapshots__/medication-detail.18b-tracking-on.json.snap @@ -62,7 +62,17 @@ "courses": [], "courseCount": 0, "previousCourseEndedOn": null, - "canStartCourse": false + "canStartCourse": false, + "nextDueAt": "2026-10-16T05:00:00.000Z", + "remindersActive": true, + "nextDueOverdue": false, + "courseStatus": "CURRENT", + "intakeActionable": true, + "stockUnitsRemaining": null, + "stockDosesRemaining": null, + "runwayDays": null, + "ingredients": [], + "related": [] }, "error": null }, diff --git a/tests/integration/routes/parity/__snapshots__/medication-detail.18c-tracking-off.json.snap b/tests/integration/routes/parity/__snapshots__/medication-detail.18c-tracking-off.json.snap index 160f86063..725e80fbf 100644 --- a/tests/integration/routes/parity/__snapshots__/medication-detail.18c-tracking-off.json.snap +++ b/tests/integration/routes/parity/__snapshots__/medication-detail.18c-tracking-off.json.snap @@ -63,7 +63,17 @@ "courses": [], "courseCount": 0, "previousCourseEndedOn": null, - "canStartCourse": false + "canStartCourse": false, + "nextDueAt": null, + "remindersActive": false, + "nextDueOverdue": false, + "courseStatus": "CURRENT", + "intakeActionable": false, + "stockUnitsRemaining": null, + "stockDosesRemaining": null, + "runwayDays": null, + "ingredients": [], + "related": [] }, "error": null }, diff --git a/tests/integration/routes/parity/__snapshots__/medication-detail.19b-scheduled.json.snap b/tests/integration/routes/parity/__snapshots__/medication-detail.19b-scheduled.json.snap index 18bea73e4..fe0b6e967 100644 --- a/tests/integration/routes/parity/__snapshots__/medication-detail.19b-scheduled.json.snap +++ b/tests/integration/routes/parity/__snapshots__/medication-detail.19b-scheduled.json.snap @@ -62,7 +62,17 @@ "courses": [], "courseCount": 0, "previousCourseEndedOn": null, - "canStartCourse": false + "canStartCourse": false, + "nextDueAt": "2026-10-16T06:00:00.000Z", + "remindersActive": true, + "nextDueOverdue": false, + "courseStatus": "CURRENT", + "intakeActionable": true, + "stockUnitsRemaining": null, + "stockDosesRemaining": null, + "runwayDays": null, + "ingredients": [], + "related": [] }, "error": null }, diff --git a/tests/integration/routes/parity/__snapshots__/medication-detail.19d-as-needed.json.snap b/tests/integration/routes/parity/__snapshots__/medication-detail.19d-as-needed.json.snap index f1c85281a..582f4f13f 100644 --- a/tests/integration/routes/parity/__snapshots__/medication-detail.19d-as-needed.json.snap +++ b/tests/integration/routes/parity/__snapshots__/medication-detail.19d-as-needed.json.snap @@ -40,7 +40,17 @@ "courses": [], "courseCount": 0, "previousCourseEndedOn": null, - "canStartCourse": false + "canStartCourse": false, + "nextDueAt": null, + "remindersActive": false, + "nextDueOverdue": false, + "courseStatus": "CURRENT", + "intakeActionable": true, + "stockUnitsRemaining": null, + "stockDosesRemaining": null, + "runwayDays": null, + "ingredients": [], + "related": [] }, "error": null }, diff --git a/tests/integration/routes/parity/__snapshots__/medication-detail.20c-one-shot.json.snap b/tests/integration/routes/parity/__snapshots__/medication-detail.20c-one-shot.json.snap index 7ca869539..0560579b9 100644 --- a/tests/integration/routes/parity/__snapshots__/medication-detail.20c-one-shot.json.snap +++ b/tests/integration/routes/parity/__snapshots__/medication-detail.20c-one-shot.json.snap @@ -71,7 +71,17 @@ ], "courseCount": 1, "previousCourseEndedOn": null, - "canStartCourse": false + "canStartCourse": false, + "nextDueAt": "2026-10-20T07:00:00.000Z", + "remindersActive": true, + "nextDueOverdue": false, + "courseStatus": "UPCOMING", + "intakeActionable": false, + "stockUnitsRemaining": null, + "stockDosesRemaining": null, + "runwayDays": null, + "ingredients": [], + "related": [] }, "error": null }, diff --git a/tests/integration/routes/parity/__snapshots__/medication-detail.21c-course-end.json.snap b/tests/integration/routes/parity/__snapshots__/medication-detail.21c-course-end.json.snap index e89aacbc9..7d472d215 100644 --- a/tests/integration/routes/parity/__snapshots__/medication-detail.21c-course-end.json.snap +++ b/tests/integration/routes/parity/__snapshots__/medication-detail.21c-course-end.json.snap @@ -79,7 +79,17 @@ ], "courseCount": 2, "previousCourseEndedOn": "2026-08-31", - "canStartCourse": false + "canStartCourse": false, + "nextDueAt": "2026-10-16T06:00:00.000Z", + "remindersActive": true, + "nextDueOverdue": false, + "courseStatus": "CURRENT", + "intakeActionable": true, + "stockUnitsRemaining": null, + "stockDosesRemaining": null, + "runwayDays": null, + "ingredients": [], + "related": [] }, "error": null }, diff --git a/tests/integration/routes/parity/__snapshots__/medication-detail.22-composition-units.json.snap b/tests/integration/routes/parity/__snapshots__/medication-detail.22-composition-units.json.snap index 50d79355e..02ed0c383 100644 --- a/tests/integration/routes/parity/__snapshots__/medication-detail.22-composition-units.json.snap +++ b/tests/integration/routes/parity/__snapshots__/medication-detail.22-composition-units.json.snap @@ -62,7 +62,27 @@ "courses": [], "courseCount": 0, "previousCourseEndedOn": null, - "canStartCourse": false + "canStartCourse": false, + "nextDueAt": "2026-10-17T07:00:00.000Z", + "remindersActive": false, + "nextDueOverdue": false, + "courseStatus": "CURRENT", + "intakeActionable": true, + "stockUnitsRemaining": 3, + "stockDosesRemaining": 1, + "runwayDays": 10, + "ingredients": [ + { + "nutrient": "vitamin_d", + "amountPerUnit": 25, + "unit": "ug", + "enteredAmount": 1000, + "enteredUnit": "IU", + "labelKey": "nutrients.names.vitamin_d", + "label": "Vitamin D" + } + ], + "related": [] }, "error": null }, diff --git a/tests/integration/routes/parity/__snapshots__/medication-detail.24b-manager.json.snap b/tests/integration/routes/parity/__snapshots__/medication-detail.24b-manager.json.snap index 46f368ca1..ee901103c 100644 --- a/tests/integration/routes/parity/__snapshots__/medication-detail.24b-manager.json.snap +++ b/tests/integration/routes/parity/__snapshots__/medication-detail.24b-manager.json.snap @@ -89,7 +89,17 @@ "courses": [], "courseCount": 0, "previousCourseEndedOn": null, - "canStartCourse": false + "canStartCourse": false, + "nextDueAt": "2026-10-16T09:30:00.000Z", + "remindersActive": false, + "nextDueOverdue": false, + "courseStatus": "CURRENT", + "intakeActionable": true, + "stockUnitsRemaining": null, + "stockDosesRemaining": null, + "runwayDays": null, + "ingredients": [], + "related": [] }, "error": null }, diff --git a/tests/integration/routes/parity/__snapshots__/medication-intake-event.03-move-by-band.json.snap b/tests/integration/routes/parity/__snapshots__/medication-intake-event.03-move-by-band.json.snap index cef0085b9..6136a16fc 100644 --- a/tests/integration/routes/parity/__snapshots__/medication-intake-event.03-move-by-band.json.snap +++ b/tests/integration/routes/parity/__snapshots__/medication-intake-event.03-move-by-band.json.snap @@ -3,12 +3,24 @@ "body": { "data": { "id": "", + "userId": "", + "medicationId": "", + "scheduledFor": "2026-10-14T20:00:00.000Z", "takenAt": "2026-10-14T20:30:00.000Z", "skipped": false, - "idempotencyKey": null, - "scheduledFor": "2026-10-14T20:00:00.000Z", + "autoMissed": false, + "autoRecorded": false, + "attributionSource": "AUTO", "source": "WEB", - "createdAt": "" + "idempotencyKey": null, + "createdAt": "", + "injectionSite": null, + "doseTaken": null, + "inventoryConsumption": null, + "externalId": null, + "updatedAt": "", + "syncVersion": "", + "deletedAt": null }, "error": null }, @@ -18,7 +30,7 @@ "action": { "name": "medication.intake.update", "entity_type": "intake_event", - "entity_id": "" + "entity_id": "" }, "meta": { "medication_id": "" @@ -32,7 +44,7 @@ "effect": "queueMedicationIntakeSync", "args": [ { - "userId": "", + "userId": "", "originDeviceToken": null } ] @@ -42,7 +54,7 @@ "medications": [ { "id": "", - "userId": "", + "userId": "", "name": "Parity one-shot", "dose": "10mg", "treatmentClass": "GENERIC", @@ -76,7 +88,7 @@ }, { "id": "", - "userId": "", + "userId": "", "name": "Parity tablet", "dose": "10mg", "treatmentClass": "GENERIC", @@ -171,7 +183,7 @@ "intakes": [ { "id": "", - "userId": "", + "userId": "", "medicationId": "", "scheduledFor": "2026-10-10T09:00:00.000Z", "takenAt": "2026-10-10T09:30:00.000Z", @@ -192,7 +204,7 @@ }, { "id": "", - "userId": "", + "userId": "", "medicationId": "", "scheduledFor": "2026-10-11T08:00:00.000Z", "takenAt": "2026-10-11T08:20:00.000Z", @@ -213,7 +225,7 @@ }, { "id": "", - "userId": "", + "userId": "", "medicationId": "", "scheduledFor": "2026-10-11T20:00:00.000Z", "takenAt": "2026-10-11T20:20:00.000Z", @@ -234,7 +246,7 @@ }, { "id": "", - "userId": "", + "userId": "", "medicationId": "", "scheduledFor": "2026-10-12T08:00:00.000Z", "takenAt": "2026-10-12T08:05:00.000Z", @@ -255,7 +267,7 @@ }, { "id": "", - "userId": "", + "userId": "", "medicationId": "", "scheduledFor": "2026-10-13T08:00:00.000Z", "takenAt": "2026-10-13T08:40:00.000Z", @@ -276,7 +288,7 @@ }, { "id": "", - "userId": "", + "userId": "", "medicationId": "", "scheduledFor": "2026-10-13T20:00:00.000Z", "takenAt": "2026-10-13T20:15:00.000Z", @@ -296,8 +308,8 @@ "deletedAt": null }, { - "id": "", - "userId": "", + "id": "", + "userId": "", "medicationId": "", "scheduledFor": "2026-10-14T08:00:00.000Z", "takenAt": "2026-10-14T08:10:00.000Z", @@ -318,7 +330,7 @@ }, { "id": "", - "userId": "", + "userId": "", "medicationId": "", "scheduledFor": "2026-10-14T20:00:00.000Z", "takenAt": "2026-10-14T20:30:00.000Z", @@ -342,7 +354,7 @@ "inventoryItems": [ { "id": "", - "userId": "", + "userId": "", "medicationId": "", "state": "IN_USE", "containerType": "OTHER", @@ -366,10 +378,10 @@ "audit": [ { "action": "medication.intake.update", - "userId": "", + "userId": "", "actorUserId": null, "details": { - "eventId": "", + "eventId": "", "medicationId": "", "fields": [ "scheduledFor", @@ -384,7 +396,7 @@ }, { "action": "medication.intake.update", - "userId": "", + "userId": "", "actorUserId": null, "details": { "eventId": "", @@ -400,7 +412,7 @@ }, { "action": "medication.intake.update", - "userId": "", + "userId": "", "actorUserId": null, "details": { "eventId": "", diff --git a/tests/integration/routes/parity/__snapshots__/medication-intake-event.04-pin-free-slot.json.snap b/tests/integration/routes/parity/__snapshots__/medication-intake-event.04-pin-free-slot.json.snap index 292c4f3a2..554560af1 100644 --- a/tests/integration/routes/parity/__snapshots__/medication-intake-event.04-pin-free-slot.json.snap +++ b/tests/integration/routes/parity/__snapshots__/medication-intake-event.04-pin-free-slot.json.snap @@ -3,12 +3,24 @@ "body": { "data": { "id": "", + "userId": "", + "medicationId": "", + "scheduledFor": "2026-10-12T20:00:00.000Z", "takenAt": "2026-10-13T20:15:00.000Z", "skipped": false, - "idempotencyKey": null, - "scheduledFor": "2026-10-12T20:00:00.000Z", + "autoMissed": false, + "autoRecorded": false, + "attributionSource": "USER_PIN", "source": "WEB", - "createdAt": "" + "idempotencyKey": null, + "createdAt": "", + "injectionSite": null, + "doseTaken": null, + "inventoryConsumption": null, + "externalId": null, + "updatedAt": "", + "syncVersion": "", + "deletedAt": null }, "error": null }, @@ -18,7 +30,7 @@ "action": { "name": "medication.intake.update", "entity_type": "intake_event", - "entity_id": "" + "entity_id": "" }, "meta": { "medication_id": "" @@ -32,7 +44,7 @@ "effect": "queueMedicationIntakeSync", "args": [ { - "userId": "", + "userId": "", "originDeviceToken": null } ] @@ -42,7 +54,7 @@ "medications": [ { "id": "", - "userId": "", + "userId": "", "name": "Parity one-shot", "dose": "10mg", "treatmentClass": "GENERIC", @@ -76,7 +88,7 @@ }, { "id": "", - "userId": "", + "userId": "", "name": "Parity tablet", "dose": "10mg", "treatmentClass": "GENERIC", @@ -171,7 +183,7 @@ "intakes": [ { "id": "", - "userId": "", + "userId": "", "medicationId": "", "scheduledFor": "2026-10-10T09:00:00.000Z", "takenAt": "2026-10-10T09:30:00.000Z", @@ -192,7 +204,7 @@ }, { "id": "", - "userId": "", + "userId": "", "medicationId": "", "scheduledFor": "2026-10-11T08:00:00.000Z", "takenAt": "2026-10-11T08:20:00.000Z", @@ -213,7 +225,7 @@ }, { "id": "", - "userId": "", + "userId": "", "medicationId": "", "scheduledFor": "2026-10-11T20:00:00.000Z", "takenAt": "2026-10-11T20:20:00.000Z", @@ -234,7 +246,7 @@ }, { "id": "", - "userId": "", + "userId": "", "medicationId": "", "scheduledFor": "2026-10-12T08:00:00.000Z", "takenAt": "2026-10-12T08:05:00.000Z", @@ -255,7 +267,7 @@ }, { "id": "", - "userId": "", + "userId": "", "medicationId": "", "scheduledFor": "2026-10-12T20:00:00.000Z", "takenAt": "2026-10-13T20:15:00.000Z", @@ -276,7 +288,7 @@ }, { "id": "", - "userId": "", + "userId": "", "medicationId": "", "scheduledFor": "2026-10-13T08:00:00.000Z", "takenAt": "2026-10-13T08:40:00.000Z", @@ -296,8 +308,8 @@ "deletedAt": null }, { - "id": "", - "userId": "", + "id": "", + "userId": "", "medicationId": "", "scheduledFor": "2026-10-13T20:00:00.000Z", "takenAt": "2026-10-13T20:15:00.000Z", @@ -318,7 +330,7 @@ }, { "id": "", - "userId": "", + "userId": "", "medicationId": "", "scheduledFor": "2026-10-14T08:00:00.000Z", "takenAt": "2026-10-14T08:10:00.000Z", @@ -339,7 +351,7 @@ }, { "id": "", - "userId": "", + "userId": "", "medicationId": "", "scheduledFor": "2026-10-14T20:00:00.000Z", "takenAt": "2026-10-14T20:30:00.000Z", @@ -363,7 +375,7 @@ "inventoryItems": [ { "id": "", - "userId": "", + "userId": "", "medicationId": "", "state": "IN_USE", "containerType": "OTHER", @@ -387,7 +399,7 @@ "audit": [ { "action": "medication.intake.update", - "userId": "", + "userId": "", "actorUserId": null, "details": { "eventId": "", @@ -405,10 +417,10 @@ }, { "action": "medication.intake.update", - "userId": "", + "userId": "", "actorUserId": null, "details": { - "eventId": "", + "eventId": "", "medicationId": "", "fields": [ "scheduledFor" @@ -421,7 +433,7 @@ }, { "action": "medication.intake.update", - "userId": "", + "userId": "", "actorUserId": null, "details": { "eventId": "", @@ -437,7 +449,7 @@ }, { "action": "medication.intake.update", - "userId": "", + "userId": "", "actorUserId": null, "details": { "eventId": "", diff --git a/tests/integration/routes/parity/__snapshots__/medication-intake-event.07-unpin.json.snap b/tests/integration/routes/parity/__snapshots__/medication-intake-event.07-unpin.json.snap index 99fba82d2..a0661d19b 100644 --- a/tests/integration/routes/parity/__snapshots__/medication-intake-event.07-unpin.json.snap +++ b/tests/integration/routes/parity/__snapshots__/medication-intake-event.07-unpin.json.snap @@ -3,12 +3,24 @@ "body": { "data": { "id": "", + "userId": "", + "medicationId": "", + "scheduledFor": "2026-10-13T20:00:00.000Z", "takenAt": "2026-10-13T20:15:00.000Z", "skipped": false, - "idempotencyKey": null, - "scheduledFor": "2026-10-13T20:00:00.000Z", + "autoMissed": false, + "autoRecorded": false, + "attributionSource": "USER_PIN", "source": "WEB", - "createdAt": "" + "idempotencyKey": null, + "createdAt": "", + "injectionSite": null, + "doseTaken": null, + "inventoryConsumption": null, + "externalId": null, + "updatedAt": "", + "syncVersion": "", + "deletedAt": null }, "error": null }, @@ -18,7 +30,7 @@ "action": { "name": "medication.intake.update", "entity_type": "intake_event", - "entity_id": "" + "entity_id": "" }, "meta": { "medication_id": "" @@ -32,7 +44,7 @@ "effect": "queueMedicationIntakeSync", "args": [ { - "userId": "", + "userId": "", "originDeviceToken": null } ] @@ -42,7 +54,7 @@ "medications": [ { "id": "", - "userId": "", + "userId": "", "name": "Parity one-shot", "dose": "10mg", "treatmentClass": "GENERIC", @@ -76,7 +88,7 @@ }, { "id": "", - "userId": "", + "userId": "", "name": "Parity tablet", "dose": "10mg", "treatmentClass": "GENERIC", @@ -171,7 +183,7 @@ "intakes": [ { "id": "", - "userId": "", + "userId": "", "medicationId": "", "scheduledFor": "2026-10-10T09:00:00.000Z", "takenAt": "2026-10-10T09:30:00.000Z", @@ -192,7 +204,7 @@ }, { "id": "", - "userId": "", + "userId": "", "medicationId": "", "scheduledFor": "2026-10-11T08:00:00.000Z", "takenAt": "2026-10-11T08:20:00.000Z", @@ -213,7 +225,7 @@ }, { "id": "", - "userId": "", + "userId": "", "medicationId": "", "scheduledFor": "2026-10-11T20:00:00.000Z", "takenAt": "2026-10-11T20:20:00.000Z", @@ -234,7 +246,7 @@ }, { "id": "", - "userId": "", + "userId": "", "medicationId": "", "scheduledFor": "2026-10-12T08:00:00.000Z", "takenAt": "2026-10-12T08:05:00.000Z", @@ -254,8 +266,8 @@ "deletedAt": "2026-10-12T09:00:00.000Z" }, { - "id": "", - "userId": "", + "id": "", + "userId": "", "medicationId": "", "scheduledFor": "2026-10-12T20:00:00.000Z", "takenAt": "2026-10-13T20:15:00.000Z", @@ -276,7 +288,7 @@ }, { "id": "", - "userId": "", + "userId": "", "medicationId": "", "scheduledFor": "2026-10-13T08:00:00.000Z", "takenAt": "2026-10-13T08:40:00.000Z", @@ -297,7 +309,7 @@ }, { "id": "", - "userId": "", + "userId": "", "medicationId": "", "scheduledFor": "2026-10-13T20:00:00.000Z", "takenAt": "2026-10-13T20:15:00.000Z", @@ -318,7 +330,7 @@ }, { "id": "", - "userId": "", + "userId": "", "medicationId": "", "scheduledFor": "2026-10-13T20:00:00.000Z", "takenAt": "2026-10-13T20:15:00.000Z", @@ -339,7 +351,7 @@ }, { "id": "", - "userId": "", + "userId": "", "medicationId": "", "scheduledFor": "2026-10-14T08:00:00.000Z", "takenAt": "2026-10-14T08:10:00.000Z", @@ -360,7 +372,7 @@ }, { "id": "", - "userId": "", + "userId": "", "medicationId": "", "scheduledFor": "2026-10-14T20:00:00.000Z", "takenAt": "2026-10-14T20:30:00.000Z", @@ -384,7 +396,7 @@ "inventoryItems": [ { "id": "", - "userId": "", + "userId": "", "medicationId": "", "state": "IN_USE", "containerType": "OTHER", @@ -408,7 +420,7 @@ "audit": [ { "action": "medication.intake.update", - "userId": "", + "userId": "", "actorUserId": null, "details": { "eventId": "", @@ -426,10 +438,10 @@ }, { "action": "medication.intake.update", - "userId": "", + "userId": "", "actorUserId": null, "details": { - "eventId": "", + "eventId": "", "medicationId": "", "fields": [ "scheduledFor" @@ -442,7 +454,7 @@ }, { "action": "medication.intake.update", - "userId": "", + "userId": "", "actorUserId": null, "details": { "eventId": "", @@ -458,7 +470,7 @@ }, { "action": "medication.intake.update", - "userId": "", + "userId": "", "actorUserId": null, "details": { "eventId": "", @@ -474,7 +486,7 @@ }, { "action": "medication.intake.update", - "userId": "", + "userId": "", "actorUserId": null, "details": { "eventId": "", diff --git a/tests/integration/routes/parity/__snapshots__/medication-intake-event.08-explicit-slot.json.snap b/tests/integration/routes/parity/__snapshots__/medication-intake-event.08-explicit-slot.json.snap index 8ca547dfa..8af962b7e 100644 --- a/tests/integration/routes/parity/__snapshots__/medication-intake-event.08-explicit-slot.json.snap +++ b/tests/integration/routes/parity/__snapshots__/medication-intake-event.08-explicit-slot.json.snap @@ -3,12 +3,24 @@ "body": { "data": { "id": "", + "userId": "", + "medicationId": "", + "scheduledFor": "2026-10-14T08:00:00.000Z", "takenAt": "2026-10-14T08:45:00.000Z", "skipped": false, - "idempotencyKey": null, - "scheduledFor": "2026-10-14T08:00:00.000Z", + "autoMissed": false, + "autoRecorded": false, + "attributionSource": "AUTO", "source": "WEB", - "createdAt": "" + "idempotencyKey": null, + "createdAt": "", + "injectionSite": null, + "doseTaken": null, + "inventoryConsumption": null, + "externalId": null, + "updatedAt": "", + "syncVersion": "", + "deletedAt": null }, "error": null }, @@ -18,7 +30,7 @@ "action": { "name": "medication.intake.update", "entity_type": "intake_event", - "entity_id": "" + "entity_id": "" }, "meta": { "medication_id": "" @@ -32,7 +44,7 @@ "effect": "queueMedicationIntakeSync", "args": [ { - "userId": "", + "userId": "", "originDeviceToken": null } ] @@ -42,7 +54,7 @@ "medications": [ { "id": "", - "userId": "", + "userId": "", "name": "Parity one-shot", "dose": "10mg", "treatmentClass": "GENERIC", @@ -76,7 +88,7 @@ }, { "id": "", - "userId": "", + "userId": "", "name": "Parity tablet", "dose": "10mg", "treatmentClass": "GENERIC", @@ -171,7 +183,7 @@ "intakes": [ { "id": "", - "userId": "", + "userId": "", "medicationId": "", "scheduledFor": "2026-10-10T09:00:00.000Z", "takenAt": "2026-10-10T09:30:00.000Z", @@ -192,7 +204,7 @@ }, { "id": "", - "userId": "", + "userId": "", "medicationId": "", "scheduledFor": "2026-10-11T08:00:00.000Z", "takenAt": "2026-10-11T08:20:00.000Z", @@ -213,7 +225,7 @@ }, { "id": "", - "userId": "", + "userId": "", "medicationId": "", "scheduledFor": "2026-10-11T20:00:00.000Z", "takenAt": "2026-10-11T20:20:00.000Z", @@ -234,7 +246,7 @@ }, { "id": "", - "userId": "", + "userId": "", "medicationId": "", "scheduledFor": "2026-10-12T08:00:00.000Z", "takenAt": "2026-10-12T08:05:00.000Z", @@ -255,7 +267,7 @@ }, { "id": "", - "userId": "", + "userId": "", "medicationId": "", "scheduledFor": "2026-10-12T20:00:00.000Z", "takenAt": "2026-10-13T20:15:00.000Z", @@ -276,7 +288,7 @@ }, { "id": "", - "userId": "", + "userId": "", "medicationId": "", "scheduledFor": "2026-10-13T08:00:00.000Z", "takenAt": "2026-10-13T08:40:00.000Z", @@ -297,7 +309,7 @@ }, { "id": "", - "userId": "", + "userId": "", "medicationId": "", "scheduledFor": "2026-10-13T20:00:00.000Z", "takenAt": "2026-10-13T20:15:00.000Z", @@ -318,7 +330,7 @@ }, { "id": "", - "userId": "", + "userId": "", "medicationId": "", "scheduledFor": "2026-10-13T20:00:00.000Z", "takenAt": "2026-10-13T20:15:00.000Z", @@ -339,7 +351,7 @@ }, { "id": "", - "userId": "", + "userId": "", "medicationId": "", "scheduledFor": "2026-10-14T08:00:00.000Z", "takenAt": "2026-10-14T08:10:00.000Z", @@ -360,7 +372,7 @@ }, { "id": "", - "userId": "", + "userId": "", "medicationId": "", "scheduledFor": "2026-10-14T08:00:00.000Z", "takenAt": "2026-10-14T08:45:00.000Z", @@ -380,8 +392,8 @@ "deletedAt": null }, { - "id": "", - "userId": "", + "id": "", + "userId": "", "medicationId": "", "scheduledFor": "2026-10-14T20:00:00.000Z", "takenAt": "2026-10-14T20:30:00.000Z", @@ -405,7 +417,7 @@ "inventoryItems": [ { "id": "", - "userId": "", + "userId": "", "medicationId": "", "state": "IN_USE", "containerType": "OTHER", @@ -429,7 +441,7 @@ "audit": [ { "action": "medication.intake.update", - "userId": "", + "userId": "", "actorUserId": null, "details": { "eventId": "", @@ -447,10 +459,10 @@ }, { "action": "medication.intake.update", - "userId": "", + "userId": "", "actorUserId": null, "details": { - "eventId": "", + "eventId": "", "medicationId": "", "fields": [ "scheduledFor", @@ -465,7 +477,7 @@ }, { "action": "medication.intake.update", - "userId": "", + "userId": "", "actorUserId": null, "details": { "eventId": "", @@ -481,7 +493,7 @@ }, { "action": "medication.intake.update", - "userId": "", + "userId": "", "actorUserId": null, "details": { "eventId": "", @@ -497,7 +509,7 @@ }, { "action": "medication.intake.update", - "userId": "", + "userId": "", "actorUserId": null, "details": { "eventId": "", @@ -513,7 +525,7 @@ }, { "action": "medication.intake.update", - "userId": "", + "userId": "", "actorUserId": null, "details": { "eventId": "", diff --git a/tests/integration/routes/parity/__snapshots__/medication-intake-status.12-take-slot-move.json.snap b/tests/integration/routes/parity/__snapshots__/medication-intake-status.12-take-slot-move.json.snap index d6d98517a..3fa6e304b 100644 --- a/tests/integration/routes/parity/__snapshots__/medication-intake-status.12-take-slot-move.json.snap +++ b/tests/integration/routes/parity/__snapshots__/medication-intake-status.12-take-slot-move.json.snap @@ -3,12 +3,24 @@ "body": { "data": { "id": "", + "userId": "", + "medicationId": "", + "scheduledFor": "2026-10-14T20:00:00.000Z", "takenAt": "2026-10-14T20:30:00.000Z", "skipped": false, - "idempotencyKey": null, - "scheduledFor": "2026-10-14T20:00:00.000Z", + "autoMissed": false, + "autoRecorded": false, + "attributionSource": "AUTO", "source": "WEB", - "createdAt": "" + "idempotencyKey": null, + "createdAt": "", + "injectionSite": "ABDOMEN_LEFT", + "doseTaken": null, + "inventoryConsumption": null, + "externalId": null, + "updatedAt": "", + "syncVersion": "", + "deletedAt": null }, "error": null }, @@ -19,13 +31,13 @@ "name": "medications.intake.update" }, "meta": { - "medication_id": "", + "medication_id": "", "units": 1, "item_ids": [ - "" + "" ], "auto_opened": 0, - "intakeId": "", + "intakeId": "", "status": "taken" }, "warnings": null, @@ -37,7 +49,7 @@ "effect": "queueMedicationIntakeSync", "args": [ { - "userId": "", + "userId": "", "originDeviceToken": null } ] @@ -45,7 +57,7 @@ { "effect": "countOutstandingDosesToday", "args": [ - "", + "", "UTC" ] }, @@ -53,9 +65,9 @@ "effect": "notifyDelegatedIntake", "args": [ { - "ownerId": "", - "actorId": "", - "medicationId": "", + "ownerId": "", + "actorId": "", + "medicationId": "", "status": "taken" } ] @@ -64,8 +76,8 @@ "effect": "dispatchMedicationIntakeWebClear", "args": [ { - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-14T20:00:00.000Z", "badgeCount": 2 } @@ -76,7 +88,7 @@ "medications": [ { "id": "", - "userId": "", + "userId": "", "name": "Daily pen", "dose": "10mg", "treatmentClass": "GENERIC", @@ -113,7 +125,7 @@ }, { "id": "", - "userId": "", + "userId": "", "name": "Record only", "dose": "10mg", "treatmentClass": "GENERIC", @@ -147,7 +159,7 @@ }, { "id": "", - "userId": "", + "userId": "", "name": "Three times", "dose": "10mg", "treatmentClass": "GENERIC", @@ -180,8 +192,8 @@ "updatedAt": "" }, { - "id": "", - "userId": "", + "id": "", + "userId": "", "name": "Twice daily", "dose": "10mg", "treatmentClass": "GENERIC", @@ -259,7 +271,7 @@ }, { "id": "", - "medicationId": "", + "medicationId": "", "windowStart": "08:00", "windowEnd": "10:00", "label": null, @@ -339,7 +351,7 @@ }, { "id": "", - "medicationId": "", + "medicationId": "", "windowStart": "20:00", "windowEnd": "22:00", "label": null, @@ -364,8 +376,8 @@ "intakes": [ { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-09T08:00:00.000Z", "takenAt": null, "skipped": false, @@ -385,8 +397,8 @@ }, { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-10T08:00:00.000Z", "takenAt": "2026-10-10T08:05:00.000Z", "skipped": false, @@ -406,8 +418,8 @@ }, { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-11T08:00:00.000Z", "takenAt": null, "skipped": false, @@ -427,8 +439,8 @@ }, { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-12T08:00:00.000Z", "takenAt": "2026-10-12T08:10:00.000Z", "skipped": false, @@ -448,7 +460,7 @@ }, { "id": "", - "userId": "", + "userId": "", "medicationId": "", "scheduledFor": "2026-10-13T07:00:00.000Z", "takenAt": "2026-10-13T07:05:00.000Z", @@ -469,8 +481,8 @@ }, { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-13T20:00:00.000Z", "takenAt": null, "skipped": false, @@ -490,7 +502,7 @@ }, { "id": "", - "userId": "", + "userId": "", "medicationId": "", "scheduledFor": "2026-10-14T07:00:00.000Z", "takenAt": null, @@ -510,9 +522,9 @@ "deletedAt": null }, { - "id": "", - "userId": "", - "medicationId": "", + "id": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-14T08:00:00.000Z", "takenAt": null, "skipped": false, @@ -532,8 +544,8 @@ }, { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-14T20:00:00.000Z", "takenAt": "2026-10-14T20:30:00.000Z", "skipped": false, @@ -548,7 +560,7 @@ "inventoryConsumption": [ { "units": 1, - "itemId": "" + "itemId": "" } ], "externalId": null, @@ -558,7 +570,7 @@ }, { "id": "", - "userId": "", + "userId": "", "medicationId": "", "scheduledFor": "2026-10-15T06:00:00.000Z", "takenAt": null, @@ -579,8 +591,8 @@ }, { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-15T08:00:00.000Z", "takenAt": "2026-10-15T08:30:00.000Z", "skipped": false, @@ -595,7 +607,7 @@ "inventoryConsumption": [ { "units": 1, - "itemId": "" + "itemId": "" } ], "externalId": null, @@ -605,7 +617,7 @@ }, { "id": "", - "userId": "", + "userId": "", "medicationId": "", "scheduledFor": "2026-10-15T09:00:00.000Z", "takenAt": null, @@ -626,7 +638,7 @@ }, { "id": "", - "userId": "", + "userId": "", "medicationId": "", "scheduledFor": "2026-10-15T10:00:00.000Z", "takenAt": "2026-10-15T10:05:00.000Z", @@ -647,7 +659,7 @@ }, { "id": "", - "userId": "", + "userId": "", "medicationId": "", "scheduledFor": "2026-10-15T13:00:00.000Z", "takenAt": null, @@ -668,8 +680,8 @@ }, { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-15T20:00:00.000Z", "takenAt": null, "skipped": false, @@ -691,9 +703,9 @@ "doseChanges": [], "inventoryItems": [ { - "id": "", - "userId": "", - "medicationId": "", + "id": "", + "userId": "", + "medicationId": "", "state": "IN_USE", "containerType": "OTHER", "unitsTotal": "30", @@ -716,7 +728,7 @@ "audit": [ { "action": "medications.intake.update", - "userId": "", + "userId": "", "actorUserId": null, "details": { "intakeId": "", @@ -726,10 +738,10 @@ }, { "action": "medications.intake.update", - "userId": "", + "userId": "", "actorUserId": null, "details": { - "intakeId": "", + "intakeId": "", "status": "taken" }, "ipAddress": null diff --git a/tests/integration/routes/parity/__snapshots__/medication-intake-status.13a-pin.json.snap b/tests/integration/routes/parity/__snapshots__/medication-intake-status.13a-pin.json.snap index 666d31663..3b10a3bff 100644 --- a/tests/integration/routes/parity/__snapshots__/medication-intake-status.13a-pin.json.snap +++ b/tests/integration/routes/parity/__snapshots__/medication-intake-status.13a-pin.json.snap @@ -3,12 +3,24 @@ "body": { "data": { "id": "", + "userId": "", + "medicationId": "", + "scheduledFor": "2026-10-13T08:00:00.000Z", "takenAt": "2026-10-13T11:00:00.000Z", "skipped": false, - "idempotencyKey": null, - "scheduledFor": "2026-10-13T08:00:00.000Z", + "autoMissed": false, + "autoRecorded": false, + "attributionSource": "AUTO", "source": "WEB", - "createdAt": "" + "idempotencyKey": null, + "createdAt": "", + "injectionSite": null, + "doseTaken": null, + "inventoryConsumption": null, + "externalId": null, + "updatedAt": "", + "syncVersion": "", + "deletedAt": null }, "error": null }, @@ -19,13 +31,13 @@ "name": "medications.intake.update" }, "meta": { - "medication_id": "", + "medication_id": "", "units": 1, "item_ids": [ - "" + "" ], "auto_opened": 0, - "intakeId": "", + "intakeId": "", "status": "taken" }, "warnings": null, @@ -37,7 +49,7 @@ "effect": "queueMedicationIntakeSync", "args": [ { - "userId": "", + "userId": "", "originDeviceToken": null } ] @@ -45,7 +57,7 @@ { "effect": "countOutstandingDosesToday", "args": [ - "", + "", "UTC" ] }, @@ -53,9 +65,9 @@ "effect": "notifyDelegatedIntake", "args": [ { - "ownerId": "", - "actorId": "", - "medicationId": "", + "ownerId": "", + "actorId": "", + "medicationId": "", "status": "taken" } ] @@ -64,8 +76,8 @@ "effect": "dispatchMedicationIntakeWebClear", "args": [ { - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-13T08:00:00.000Z", "badgeCount": 2 } @@ -76,7 +88,7 @@ "medications": [ { "id": "", - "userId": "", + "userId": "", "name": "Daily pen", "dose": "10mg", "treatmentClass": "GENERIC", @@ -113,7 +125,7 @@ }, { "id": "", - "userId": "", + "userId": "", "name": "Record only", "dose": "10mg", "treatmentClass": "GENERIC", @@ -147,7 +159,7 @@ }, { "id": "", - "userId": "", + "userId": "", "name": "Three times", "dose": "10mg", "treatmentClass": "GENERIC", @@ -180,8 +192,8 @@ "updatedAt": "" }, { - "id": "", - "userId": "", + "id": "", + "userId": "", "name": "Twice daily", "dose": "10mg", "treatmentClass": "GENERIC", @@ -259,7 +271,7 @@ }, { "id": "", - "medicationId": "", + "medicationId": "", "windowStart": "08:00", "windowEnd": "10:00", "label": null, @@ -339,7 +351,7 @@ }, { "id": "", - "medicationId": "", + "medicationId": "", "windowStart": "20:00", "windowEnd": "22:00", "label": null, @@ -364,8 +376,8 @@ "intakes": [ { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-09T08:00:00.000Z", "takenAt": null, "skipped": false, @@ -385,8 +397,8 @@ }, { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-10T08:00:00.000Z", "takenAt": "2026-10-10T08:05:00.000Z", "skipped": false, @@ -406,8 +418,8 @@ }, { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-11T08:00:00.000Z", "takenAt": null, "skipped": false, @@ -427,8 +439,8 @@ }, { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-12T08:00:00.000Z", "takenAt": "2026-10-12T08:10:00.000Z", "skipped": false, @@ -448,7 +460,7 @@ }, { "id": "", - "userId": "", + "userId": "", "medicationId": "", "scheduledFor": "2026-10-13T07:00:00.000Z", "takenAt": "2026-10-13T07:05:00.000Z", @@ -469,8 +481,8 @@ }, { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-13T08:00:00.000Z", "takenAt": "2026-10-13T11:00:00.000Z", "skipped": false, @@ -485,7 +497,7 @@ "inventoryConsumption": [ { "units": 1, - "itemId": "" + "itemId": "" } ], "externalId": null, @@ -494,9 +506,9 @@ "deletedAt": null }, { - "id": "", - "userId": "", - "medicationId": "", + "id": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-13T20:00:00.000Z", "takenAt": null, "skipped": false, @@ -516,7 +528,7 @@ }, { "id": "", - "userId": "", + "userId": "", "medicationId": "", "scheduledFor": "2026-10-14T07:00:00.000Z", "takenAt": null, @@ -537,8 +549,8 @@ }, { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-14T08:00:00.000Z", "takenAt": null, "skipped": false, @@ -558,8 +570,8 @@ }, { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-14T20:00:00.000Z", "takenAt": "2026-10-14T20:30:00.000Z", "skipped": false, @@ -574,7 +586,7 @@ "inventoryConsumption": [ { "units": 1, - "itemId": "" + "itemId": "" } ], "externalId": null, @@ -584,7 +596,7 @@ }, { "id": "", - "userId": "", + "userId": "", "medicationId": "", "scheduledFor": "2026-10-15T06:00:00.000Z", "takenAt": null, @@ -605,8 +617,8 @@ }, { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-15T08:00:00.000Z", "takenAt": "2026-10-15T08:30:00.000Z", "skipped": false, @@ -621,7 +633,7 @@ "inventoryConsumption": [ { "units": 1, - "itemId": "" + "itemId": "" } ], "externalId": null, @@ -631,7 +643,7 @@ }, { "id": "", - "userId": "", + "userId": "", "medicationId": "", "scheduledFor": "2026-10-15T09:00:00.000Z", "takenAt": null, @@ -652,7 +664,7 @@ }, { "id": "", - "userId": "", + "userId": "", "medicationId": "", "scheduledFor": "2026-10-15T10:00:00.000Z", "takenAt": "2026-10-15T10:05:00.000Z", @@ -673,7 +685,7 @@ }, { "id": "", - "userId": "", + "userId": "", "medicationId": "", "scheduledFor": "2026-10-15T13:00:00.000Z", "takenAt": null, @@ -694,8 +706,8 @@ }, { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-15T20:00:00.000Z", "takenAt": null, "skipped": false, @@ -717,9 +729,9 @@ "doseChanges": [], "inventoryItems": [ { - "id": "", - "userId": "", - "medicationId": "", + "id": "", + "userId": "", + "medicationId": "", "state": "IN_USE", "containerType": "OTHER", "unitsTotal": "30", @@ -742,7 +754,7 @@ "audit": [ { "action": "medications.intake.update", - "userId": "", + "userId": "", "actorUserId": null, "details": { "intakeId": "", @@ -752,7 +764,7 @@ }, { "action": "medications.intake.update", - "userId": "", + "userId": "", "actorUserId": null, "details": { "intakeId": "", @@ -762,10 +774,10 @@ }, { "action": "medications.intake.update", - "userId": "", + "userId": "", "actorUserId": null, "details": { - "intakeId": "", + "intakeId": "", "status": "taken" }, "ipAddress": null diff --git a/tests/integration/routes/parity/__snapshots__/medication-intake-status.20a-writer-take.json.snap b/tests/integration/routes/parity/__snapshots__/medication-intake-status.20a-writer-take.json.snap index bd0c5ac92..a7a6cb365 100644 --- a/tests/integration/routes/parity/__snapshots__/medication-intake-status.20a-writer-take.json.snap +++ b/tests/integration/routes/parity/__snapshots__/medication-intake-status.20a-writer-take.json.snap @@ -3,12 +3,29 @@ "body": { "data": { "id": "", + "userId": "", + "medicationId": "", + "scheduledFor": "2026-10-15T08:00:00.000Z", "takenAt": "", "skipped": false, - "idempotencyKey": null, - "scheduledFor": "2026-10-15T08:00:00.000Z", + "autoMissed": false, + "autoRecorded": false, + "attributionSource": "AUTO", "source": "REMINDER", - "createdAt": "" + "idempotencyKey": null, + "createdAt": "", + "injectionSite": null, + "doseTaken": null, + "inventoryConsumption": [ + { + "units": 1, + "itemId": "" + } + ], + "externalId": null, + "updatedAt": "", + "syncVersion": "", + "deletedAt": null }, "error": null }, @@ -19,7 +36,7 @@ "name": "medications.intake.update" }, "meta": { - "intakeId": "", + "intakeId": "", "status": "taken" }, "warnings": null, @@ -31,7 +48,7 @@ "effect": "queueMedicationIntakeSync", "args": [ { - "userId": "", + "userId": "", "originDeviceToken": null } ] @@ -39,7 +56,7 @@ { "effect": "countOutstandingDosesToday", "args": [ - "", + "", "UTC" ] }, @@ -47,9 +64,9 @@ "effect": "notifyDelegatedIntake", "args": [ { - "ownerId": "", - "actorId": "", - "medicationId": "", + "ownerId": "", + "actorId": "", + "medicationId": "", "status": "taken" } ] @@ -58,8 +75,8 @@ "effect": "dispatchMedicationIntakeWebClear", "args": [ { - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-15T08:00:00.000Z", "badgeCount": 2 } @@ -69,8 +86,8 @@ "stored": { "medications": [ { - "id": "", - "userId": "", + "id": "", + "userId": "", "name": "Daily pen", "dose": "10mg", "treatmentClass": "GENERIC", @@ -106,8 +123,8 @@ "updatedAt": "" }, { - "id": "", - "userId": "", + "id": "", + "userId": "", "name": "Record only", "dose": "10mg", "treatmentClass": "GENERIC", @@ -140,8 +157,8 @@ "updatedAt": "" }, { - "id": "", - "userId": "", + "id": "", + "userId": "", "name": "Three times", "dose": "10mg", "treatmentClass": "GENERIC", @@ -174,8 +191,8 @@ "updatedAt": "" }, { - "id": "", - "userId": "", + "id": "", + "userId": "", "name": "Twice daily", "dose": "10mg", "treatmentClass": "GENERIC", @@ -212,8 +229,8 @@ ], "schedules": [ { - "id": "", - "medicationId": "", + "id": "", + "medicationId": "", "windowStart": "06:00", "windowEnd": "07:00", "label": null, @@ -232,8 +249,8 @@ "doseWindows": null }, { - "id": "", - "medicationId": "", + "id": "", + "medicationId": "", "windowStart": "07:00", "windowEnd": "08:00", "label": null, @@ -252,8 +269,8 @@ "doseWindows": null }, { - "id": "", - "medicationId": "", + "id": "", + "medicationId": "", "windowStart": "08:00", "windowEnd": "10:00", "label": null, @@ -272,8 +289,8 @@ "doseWindows": null }, { - "id": "", - "medicationId": "", + "id": "", + "medicationId": "", "windowStart": "09:00", "windowEnd": "11:00", "label": null, @@ -292,8 +309,8 @@ "doseWindows": null }, { - "id": "", - "medicationId": "", + "id": "", + "medicationId": "", "windowStart": "10:00", "windowEnd": "11:00", "label": null, @@ -312,8 +329,8 @@ "doseWindows": null }, { - "id": "", - "medicationId": "", + "id": "", + "medicationId": "", "windowStart": "13:00", "windowEnd": "14:00", "label": null, @@ -332,8 +349,8 @@ "doseWindows": null }, { - "id": "", - "medicationId": "", + "id": "", + "medicationId": "", "windowStart": "20:00", "windowEnd": "22:00", "label": null, @@ -357,9 +374,9 @@ "courses": [], "intakes": [ { - "id": "", - "userId": "", - "medicationId": "", + "id": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-09T08:00:00.000Z", "takenAt": null, "skipped": false, @@ -378,9 +395,9 @@ "deletedAt": "2026-10-09T09:00:00.000Z" }, { - "id": "", - "userId": "", - "medicationId": "", + "id": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-10T08:00:00.000Z", "takenAt": "2026-10-10T08:05:00.000Z", "skipped": false, @@ -399,9 +416,9 @@ "deletedAt": null }, { - "id": "", - "userId": "", - "medicationId": "", + "id": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-11T08:00:00.000Z", "takenAt": null, "skipped": false, @@ -420,9 +437,9 @@ "deletedAt": null }, { - "id": "", - "userId": "", - "medicationId": "", + "id": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-12T08:00:00.000Z", "takenAt": null, "skipped": true, @@ -441,9 +458,9 @@ "deletedAt": null }, { - "id": "", - "userId": "", - "medicationId": "", + "id": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-13T07:00:00.000Z", "takenAt": "2026-10-13T07:20:00.000Z", "skipped": false, @@ -462,9 +479,9 @@ "deletedAt": null }, { - "id": "", - "userId": "", - "medicationId": "", + "id": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-13T08:00:00.000Z", "takenAt": "2026-10-13T11:00:00.000Z", "skipped": false, @@ -479,7 +496,7 @@ "inventoryConsumption": [ { "units": 1, - "itemId": "" + "itemId": "" } ], "externalId": null, @@ -489,8 +506,8 @@ }, { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-13T20:00:00.000Z", "takenAt": null, "skipped": false, @@ -510,8 +527,8 @@ }, { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-14T07:00:00.000Z", "takenAt": null, "skipped": false, @@ -531,8 +548,8 @@ }, { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-14T08:00:00.000Z", "takenAt": null, "skipped": false, @@ -552,8 +569,8 @@ }, { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-14T20:00:00.000Z", "takenAt": "2026-10-14T20:30:00.000Z", "skipped": false, @@ -568,7 +585,7 @@ "inventoryConsumption": [ { "units": 1, - "itemId": "" + "itemId": "" } ], "externalId": null, @@ -578,8 +595,8 @@ }, { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-15T06:00:00.000Z", "takenAt": null, "skipped": false, @@ -599,8 +616,8 @@ }, { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-15T08:00:00.000Z", "takenAt": "", "skipped": false, @@ -615,7 +632,7 @@ "inventoryConsumption": [ { "units": 1, - "itemId": "" + "itemId": "" } ], "externalId": null, @@ -625,8 +642,8 @@ }, { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-15T09:00:00.000Z", "takenAt": "2026-10-15T09:15:00.000Z", "skipped": false, @@ -646,8 +663,8 @@ }, { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-15T10:00:00.000Z", "takenAt": "2026-10-15T10:05:00.000Z", "skipped": false, @@ -667,8 +684,8 @@ }, { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-15T13:00:00.000Z", "takenAt": null, "skipped": true, @@ -687,9 +704,9 @@ "deletedAt": null }, { - "id": "", - "userId": "", - "medicationId": "", + "id": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-15T20:00:00.000Z", "takenAt": null, "skipped": false, @@ -711,9 +728,9 @@ "doseChanges": [], "inventoryItems": [ { - "id": "", - "userId": "", - "medicationId": "", + "id": "", + "userId": "", + "medicationId": "", "state": "IN_USE", "containerType": "OTHER", "unitsTotal": "30", @@ -736,47 +753,47 @@ "audit": [ { "action": "medications.intake.update", - "userId": "", - "actorUserId": "", + "userId": "", + "actorUserId": "", "details": { - "intakeId": "", + "intakeId": "", "status": "taken" }, "ipAddress": null }, { "action": "medications.intake.update", - "userId": "", + "userId": "", "actorUserId": null, "details": { - "intakeId": "", + "intakeId": "", "status": "skipped" }, "ipAddress": null }, { "action": "medications.intake.update", - "userId": "", + "userId": "", "actorUserId": null, "details": { - "intakeId": "", + "intakeId": "", "status": "snoozed" }, "ipAddress": null }, { "action": "medications.intake.update", - "userId": "", + "userId": "", "actorUserId": null, "details": { - "intakeId": "", + "intakeId": "", "status": "snoozed" }, "ipAddress": null }, { "action": "medications.intake.update", - "userId": "", + "userId": "", "actorUserId": null, "details": { "intakeId": "", @@ -786,7 +803,7 @@ }, { "action": "medications.intake.update", - "userId": "", + "userId": "", "actorUserId": null, "details": { "intakeId": "", @@ -796,7 +813,7 @@ }, { "action": "medications.intake.update", - "userId": "", + "userId": "", "actorUserId": null, "details": { "intakeId": "", @@ -806,17 +823,17 @@ }, { "action": "medications.intake.update", - "userId": "", + "userId": "", "actorUserId": null, "details": { - "intakeId": "", + "intakeId": "", "status": "taken" }, "ipAddress": null }, { "action": "medications.intake.update", - "userId": "", + "userId": "", "actorUserId": null, "details": { "intakeId": "", diff --git a/tests/integration/routes/parity/__snapshots__/medication-intake.01-take-in-band.json.snap b/tests/integration/routes/parity/__snapshots__/medication-intake.01-take-in-band.json.snap index b77e18c79..beb3a4a7a 100644 --- a/tests/integration/routes/parity/__snapshots__/medication-intake.01-take-in-band.json.snap +++ b/tests/integration/routes/parity/__snapshots__/medication-intake.01-take-in-band.json.snap @@ -3,12 +3,24 @@ "body": { "data": { "id": "", + "userId": "", + "medicationId": "", + "scheduledFor": "2026-10-15T08:00:00.000Z", "takenAt": "2026-10-15T08:30:00.000Z", "skipped": false, - "idempotencyKey": null, - "scheduledFor": "2026-10-15T08:00:00.000Z", + "autoMissed": false, + "autoRecorded": false, + "attributionSource": "AUTO", "source": "REMINDER", - "createdAt": "" + "idempotencyKey": null, + "createdAt": "", + "injectionSite": null, + "doseTaken": null, + "inventoryConsumption": null, + "externalId": null, + "updatedAt": "", + "syncVersion": "", + "deletedAt": null }, "error": null }, @@ -21,10 +33,10 @@ "entity_id": "" }, "meta": { - "medication_id": "", + "medication_id": "", "units": 1, "item_ids": [ - "" + "" ], "auto_opened": 1, "skipped": false @@ -38,7 +50,7 @@ "effect": "queueMedicationIntakeSync", "args": [ { - "userId": "", + "userId": "", "originDeviceToken": null } ] @@ -46,7 +58,7 @@ { "effect": "countOutstandingDosesToday", "args": [ - "", + "", "UTC" ] }, @@ -54,9 +66,9 @@ "effect": "notifyDelegatedIntake", "args": [ { - "ownerId": "", - "actorId": "", - "medicationId": "", + "ownerId": "", + "actorId": "", + "medicationId": "", "status": "taken" } ] @@ -65,8 +77,8 @@ "effect": "dispatchMedicationIntakeWebClear", "args": [ { - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-15T08:00:00.000Z", "badgeCount": 2 } @@ -77,7 +89,7 @@ "medications": [ { "id": "", - "userId": "", + "userId": "", "name": "As needed", "dose": "10mg", "treatmentClass": "GENERIC", @@ -111,7 +123,7 @@ }, { "id": "", - "userId": "", + "userId": "", "name": "Record only", "dose": "10mg", "treatmentClass": "GENERIC", @@ -145,7 +157,7 @@ }, { "id": "", - "userId": "", + "userId": "", "name": "Single shot", "dose": "10mg", "treatmentClass": "GENERIC", @@ -178,8 +190,8 @@ "updatedAt": "" }, { - "id": "", - "userId": "", + "id": "", + "userId": "", "name": "Twice daily", "dose": "10mg", "treatmentClass": "GENERIC", @@ -213,7 +225,7 @@ }, { "id": "", - "userId": "", + "userId": "", "name": "Weekly pen", "dose": "10mg", "treatmentClass": "GENERIC", @@ -272,7 +284,7 @@ }, { "id": "", - "medicationId": "", + "medicationId": "", "windowStart": "08:00", "windowEnd": "10:00", "label": null, @@ -332,7 +344,7 @@ }, { "id": "", - "medicationId": "", + "medicationId": "", "windowStart": "20:00", "windowEnd": "22:00", "label": null, @@ -357,8 +369,8 @@ "intakes": [ { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-12T20:00:00.000Z", "takenAt": null, "skipped": true, @@ -378,8 +390,8 @@ }, { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-13T08:00:00.000Z", "takenAt": null, "skipped": false, @@ -399,8 +411,8 @@ }, { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-14T20:00:00.000Z", "takenAt": "2026-10-14T20:05:00.000Z", "skipped": false, @@ -420,8 +432,8 @@ }, { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-15T08:00:00.000Z", "takenAt": "2026-10-15T08:30:00.000Z", "skipped": false, @@ -436,7 +448,7 @@ "inventoryConsumption": [ { "units": 1, - "itemId": "" + "itemId": "" } ], "externalId": null, @@ -448,9 +460,9 @@ "doseChanges": [], "inventoryItems": [ { - "id": "", - "userId": "", - "medicationId": "", + "id": "", + "userId": "", + "medicationId": "", "state": "IN_USE", "containerType": "OTHER", "unitsTotal": "30", @@ -473,10 +485,10 @@ "audit": [ { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { - "medicationId": "", + "medicationId": "", "eventId": "", "skipped": false }, diff --git a/tests/integration/routes/parity/__snapshots__/medication-intake.03a-skip-named-slot.json.snap b/tests/integration/routes/parity/__snapshots__/medication-intake.03a-skip-named-slot.json.snap index ad845eda4..3187012c4 100644 --- a/tests/integration/routes/parity/__snapshots__/medication-intake.03a-skip-named-slot.json.snap +++ b/tests/integration/routes/parity/__snapshots__/medication-intake.03a-skip-named-slot.json.snap @@ -3,12 +3,24 @@ "body": { "data": { "id": "", + "userId": "", + "medicationId": "", + "scheduledFor": "2026-10-15T20:00:00.000Z", "takenAt": null, "skipped": true, - "idempotencyKey": null, - "scheduledFor": "2026-10-15T20:00:00.000Z", + "autoMissed": false, + "autoRecorded": false, + "attributionSource": "AUTO", "source": "WEB", - "createdAt": "" + "idempotencyKey": null, + "createdAt": "", + "injectionSite": null, + "doseTaken": null, + "inventoryConsumption": null, + "externalId": null, + "updatedAt": "", + "syncVersion": "", + "deletedAt": null }, "error": null }, @@ -21,7 +33,7 @@ "entity_id": "" }, "meta": { - "medication_id": "", + "medication_id": "", "skipped": true }, "warnings": null, @@ -33,7 +45,7 @@ "effect": "queueMedicationIntakeSync", "args": [ { - "userId": "", + "userId": "", "originDeviceToken": null } ] @@ -41,7 +53,7 @@ { "effect": "countOutstandingDosesToday", "args": [ - "", + "", "UTC" ] }, @@ -49,9 +61,9 @@ "effect": "notifyDelegatedIntake", "args": [ { - "ownerId": "", - "actorId": "", - "medicationId": "", + "ownerId": "", + "actorId": "", + "medicationId": "", "status": "skipped" } ] @@ -60,8 +72,8 @@ "effect": "dispatchMedicationIntakeWebClear", "args": [ { - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-15T20:00:00.000Z", "badgeCount": 2 } @@ -72,7 +84,7 @@ "medications": [ { "id": "", - "userId": "", + "userId": "", "name": "As needed", "dose": "10mg", "treatmentClass": "GENERIC", @@ -106,7 +118,7 @@ }, { "id": "", - "userId": "", + "userId": "", "name": "Record only", "dose": "10mg", "treatmentClass": "GENERIC", @@ -140,7 +152,7 @@ }, { "id": "", - "userId": "", + "userId": "", "name": "Single shot", "dose": "10mg", "treatmentClass": "GENERIC", @@ -173,8 +185,8 @@ "updatedAt": "" }, { - "id": "", - "userId": "", + "id": "", + "userId": "", "name": "Twice daily", "dose": "10mg", "treatmentClass": "GENERIC", @@ -208,7 +220,7 @@ }, { "id": "", - "userId": "", + "userId": "", "name": "Weekly pen", "dose": "10mg", "treatmentClass": "GENERIC", @@ -267,7 +279,7 @@ }, { "id": "", - "medicationId": "", + "medicationId": "", "windowStart": "08:00", "windowEnd": "10:00", "label": null, @@ -327,7 +339,7 @@ }, { "id": "", - "medicationId": "", + "medicationId": "", "windowStart": "20:00", "windowEnd": "22:00", "label": null, @@ -352,8 +364,8 @@ "intakes": [ { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-12T20:00:00.000Z", "takenAt": null, "skipped": true, @@ -373,8 +385,8 @@ }, { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-13T08:00:00.000Z", "takenAt": null, "skipped": false, @@ -394,8 +406,8 @@ }, { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-14T20:00:00.000Z", "takenAt": "2026-10-14T20:05:00.000Z", "skipped": false, @@ -415,8 +427,8 @@ }, { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-15T08:00:00.000Z", "takenAt": "2026-10-15T08:30:00.000Z", "skipped": false, @@ -441,7 +453,7 @@ }, { "id": "", - "userId": "", + "userId": "", "medicationId": "", "scheduledFor": "2026-10-15T11:00:00.000Z", "takenAt": "2026-10-15T11:00:00.000Z", @@ -462,8 +474,8 @@ }, { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-15T20:00:00.000Z", "takenAt": null, "skipped": true, @@ -486,8 +498,8 @@ "inventoryItems": [ { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "state": "IN_USE", "containerType": "OTHER", "unitsTotal": "30", @@ -510,10 +522,10 @@ "audit": [ { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { - "medicationId": "", + "medicationId": "", "eventId": "", "skipped": false }, @@ -521,7 +533,7 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { "medicationId": "", @@ -532,10 +544,10 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { - "medicationId": "", + "medicationId": "", "eventId": "", "skipped": true }, diff --git a/tests/integration/routes/parity/__snapshots__/medication-intake.03b-skip-slotless.json.snap b/tests/integration/routes/parity/__snapshots__/medication-intake.03b-skip-slotless.json.snap index e7d80ad2d..4a8993e7b 100644 --- a/tests/integration/routes/parity/__snapshots__/medication-intake.03b-skip-slotless.json.snap +++ b/tests/integration/routes/parity/__snapshots__/medication-intake.03b-skip-slotless.json.snap @@ -3,12 +3,29 @@ "body": { "data": { "id": "", + "userId": "", + "medicationId": "", + "scheduledFor": "2026-10-15T08:00:00.000Z", "takenAt": null, "skipped": true, - "idempotencyKey": null, - "scheduledFor": "2026-10-15T08:00:00.000Z", + "autoMissed": false, + "autoRecorded": false, + "attributionSource": "AUTO", "source": "REMINDER", - "createdAt": "" + "idempotencyKey": null, + "createdAt": "", + "injectionSite": null, + "doseTaken": null, + "inventoryConsumption": [ + { + "units": 1, + "itemId": "" + } + ], + "externalId": null, + "updatedAt": "", + "syncVersion": "", + "deletedAt": null }, "error": null }, @@ -21,10 +38,10 @@ "entity_id": "" }, "meta": { - "medication_id": "", + "medication_id": "", "units": 1, "item_ids": [ - "" + "" ], "skipped": true }, @@ -37,7 +54,7 @@ "effect": "queueMedicationIntakeSync", "args": [ { - "userId": "", + "userId": "", "originDeviceToken": null } ] @@ -45,7 +62,7 @@ { "effect": "countOutstandingDosesToday", "args": [ - "", + "", "UTC" ] }, @@ -53,9 +70,9 @@ "effect": "notifyDelegatedIntake", "args": [ { - "ownerId": "", - "actorId": "", - "medicationId": "", + "ownerId": "", + "actorId": "", + "medicationId": "", "status": "skipped" } ] @@ -64,8 +81,8 @@ "effect": "dispatchMedicationIntakeWebClear", "args": [ { - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-15T08:00:00.000Z", "badgeCount": 2 } @@ -76,7 +93,7 @@ "medications": [ { "id": "", - "userId": "", + "userId": "", "name": "As needed", "dose": "10mg", "treatmentClass": "GENERIC", @@ -110,7 +127,7 @@ }, { "id": "", - "userId": "", + "userId": "", "name": "Record only", "dose": "10mg", "treatmentClass": "GENERIC", @@ -144,7 +161,7 @@ }, { "id": "", - "userId": "", + "userId": "", "name": "Single shot", "dose": "10mg", "treatmentClass": "GENERIC", @@ -177,8 +194,8 @@ "updatedAt": "" }, { - "id": "", - "userId": "", + "id": "", + "userId": "", "name": "Twice daily", "dose": "10mg", "treatmentClass": "GENERIC", @@ -212,7 +229,7 @@ }, { "id": "", - "userId": "", + "userId": "", "name": "Weekly pen", "dose": "10mg", "treatmentClass": "GENERIC", @@ -271,7 +288,7 @@ }, { "id": "", - "medicationId": "", + "medicationId": "", "windowStart": "08:00", "windowEnd": "10:00", "label": null, @@ -331,7 +348,7 @@ }, { "id": "", - "medicationId": "", + "medicationId": "", "windowStart": "20:00", "windowEnd": "22:00", "label": null, @@ -356,8 +373,8 @@ "intakes": [ { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-12T20:00:00.000Z", "takenAt": null, "skipped": true, @@ -377,8 +394,8 @@ }, { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-13T08:00:00.000Z", "takenAt": null, "skipped": false, @@ -398,8 +415,8 @@ }, { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-14T20:00:00.000Z", "takenAt": "2026-10-14T20:05:00.000Z", "skipped": false, @@ -419,8 +436,8 @@ }, { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-15T08:00:00.000Z", "takenAt": null, "skipped": true, @@ -440,7 +457,7 @@ }, { "id": "", - "userId": "", + "userId": "", "medicationId": "", "scheduledFor": "2026-10-15T11:00:00.000Z", "takenAt": "2026-10-15T11:00:00.000Z", @@ -461,8 +478,8 @@ }, { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-15T20:00:00.000Z", "takenAt": null, "skipped": true, @@ -484,9 +501,9 @@ "doseChanges": [], "inventoryItems": [ { - "id": "", - "userId": "", - "medicationId": "", + "id": "", + "userId": "", + "medicationId": "", "state": "IN_USE", "containerType": "OTHER", "unitsTotal": "30", @@ -509,10 +526,10 @@ "audit": [ { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { - "medicationId": "", + "medicationId": "", "eventId": "", "skipped": false }, @@ -520,7 +537,7 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { "medicationId": "", @@ -531,10 +548,10 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { - "medicationId": "", + "medicationId": "", "eventId": "", "skipped": true }, @@ -542,10 +559,10 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { - "medicationId": "", + "medicationId": "", "eventId": "", "skipped": true }, diff --git a/tests/integration/routes/parity/__snapshots__/medication-intake.03d-owner-skip-standalone.json.snap b/tests/integration/routes/parity/__snapshots__/medication-intake.03d-owner-skip-standalone.json.snap index ea57265ca..b10338d3a 100644 --- a/tests/integration/routes/parity/__snapshots__/medication-intake.03d-owner-skip-standalone.json.snap +++ b/tests/integration/routes/parity/__snapshots__/medication-intake.03d-owner-skip-standalone.json.snap @@ -3,12 +3,24 @@ "body": { "data": { "id": "", + "userId": "", + "medicationId": "", + "scheduledFor": "2026-10-15T11:00:00.000Z", "takenAt": null, "skipped": true, - "idempotencyKey": null, - "scheduledFor": "2026-10-15T11:00:00.000Z", + "autoMissed": false, + "autoRecorded": false, + "attributionSource": "AUTO", "source": "WEB", - "createdAt": "" + "idempotencyKey": null, + "createdAt": "", + "injectionSite": null, + "doseTaken": null, + "inventoryConsumption": [], + "externalId": null, + "updatedAt": "", + "syncVersion": "", + "deletedAt": null }, "error": null }, @@ -21,7 +33,7 @@ "entity_id": "" }, "meta": { - "medication_id": "", + "medication_id": "", "skipped": true }, "warnings": null, @@ -33,7 +45,7 @@ "effect": "queueMedicationIntakeSync", "args": [ { - "userId": "", + "userId": "", "originDeviceToken": null } ] @@ -41,7 +53,7 @@ { "effect": "countOutstandingDosesToday", "args": [ - "", + "", "UTC" ] }, @@ -49,9 +61,9 @@ "effect": "notifyDelegatedIntake", "args": [ { - "ownerId": "", - "actorId": "", - "medicationId": "", + "ownerId": "", + "actorId": "", + "medicationId": "", "status": "skipped" } ] @@ -60,8 +72,8 @@ "effect": "dispatchMedicationIntakeWebClear", "args": [ { - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-15T11:00:00.000Z", "badgeCount": 2 } @@ -71,8 +83,8 @@ "stored": { "medications": [ { - "id": "", - "userId": "", + "id": "", + "userId": "", "name": "As needed", "dose": "10mg", "treatmentClass": "GENERIC", @@ -106,7 +118,7 @@ }, { "id": "", - "userId": "", + "userId": "", "name": "Record only", "dose": "10mg", "treatmentClass": "GENERIC", @@ -140,7 +152,7 @@ }, { "id": "", - "userId": "", + "userId": "", "name": "Single shot", "dose": "10mg", "treatmentClass": "GENERIC", @@ -174,7 +186,7 @@ }, { "id": "", - "userId": "", + "userId": "", "name": "Twice daily", "dose": "10mg", "treatmentClass": "GENERIC", @@ -208,7 +220,7 @@ }, { "id": "", - "userId": "", + "userId": "", "name": "Weekly pen", "dose": "10mg", "treatmentClass": "GENERIC", @@ -352,7 +364,7 @@ "intakes": [ { "id": "", - "userId": "", + "userId": "", "medicationId": "", "scheduledFor": "2026-10-12T20:00:00.000Z", "takenAt": null, @@ -373,7 +385,7 @@ }, { "id": "", - "userId": "", + "userId": "", "medicationId": "", "scheduledFor": "2026-10-13T08:00:00.000Z", "takenAt": null, @@ -394,7 +406,7 @@ }, { "id": "", - "userId": "", + "userId": "", "medicationId": "", "scheduledFor": "2026-10-14T20:00:00.000Z", "takenAt": "2026-10-14T20:05:00.000Z", @@ -415,7 +427,7 @@ }, { "id": "", - "userId": "", + "userId": "", "medicationId": "", "scheduledFor": "2026-10-15T08:00:00.000Z", "takenAt": null, @@ -436,8 +448,8 @@ }, { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-15T11:00:00.000Z", "takenAt": null, "skipped": true, @@ -457,7 +469,7 @@ }, { "id": "", - "userId": "", + "userId": "", "medicationId": "", "scheduledFor": "2026-10-15T20:00:00.000Z", "takenAt": null, @@ -481,7 +493,7 @@ "inventoryItems": [ { "id": "", - "userId": "", + "userId": "", "medicationId": "", "state": "IN_USE", "containerType": "OTHER", @@ -505,7 +517,7 @@ "audit": [ { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { "medicationId": "", @@ -516,10 +528,10 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { - "medicationId": "", + "medicationId": "", "eventId": "", "skipped": false }, @@ -527,7 +539,7 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { "medicationId": "", @@ -538,7 +550,7 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { "medicationId": "", @@ -549,10 +561,10 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { - "medicationId": "", + "medicationId": "", "eventId": "", "skipped": true }, @@ -560,10 +572,10 @@ }, { "action": "medications.intake.update.refused", - "userId": "", + "userId": "", "actorUserId": "", "details": { - "medicationId": "", + "medicationId": "", "reason": "resolved_event" }, "ipAddress": null diff --git a/tests/integration/routes/parity/__snapshots__/medication-intake.04a-pin.json.snap b/tests/integration/routes/parity/__snapshots__/medication-intake.04a-pin.json.snap index b2b4705c1..56d4d628a 100644 --- a/tests/integration/routes/parity/__snapshots__/medication-intake.04a-pin.json.snap +++ b/tests/integration/routes/parity/__snapshots__/medication-intake.04a-pin.json.snap @@ -3,12 +3,24 @@ "body": { "data": { "id": "", + "userId": "", + "medicationId": "", + "scheduledFor": "2026-10-14T08:00:00.000Z", "takenAt": "2026-10-14T11:00:00.000Z", "skipped": false, - "idempotencyKey": null, - "scheduledFor": "2026-10-14T08:00:00.000Z", + "autoMissed": false, + "autoRecorded": false, + "attributionSource": "USER_PIN", "source": "WEB", - "createdAt": "" + "idempotencyKey": null, + "createdAt": "", + "injectionSite": null, + "doseTaken": null, + "inventoryConsumption": null, + "externalId": null, + "updatedAt": "", + "syncVersion": "", + "deletedAt": null }, "error": null }, @@ -21,10 +33,10 @@ "entity_id": "" }, "meta": { - "medication_id": "", + "medication_id": "", "units": 1, "item_ids": [ - "" + "" ], "auto_opened": 0, "skipped": false @@ -38,7 +50,7 @@ "effect": "queueMedicationIntakeSync", "args": [ { - "userId": "", + "userId": "", "originDeviceToken": null } ] @@ -46,7 +58,7 @@ { "effect": "countOutstandingDosesToday", "args": [ - "", + "", "UTC" ] }, @@ -54,9 +66,9 @@ "effect": "notifyDelegatedIntake", "args": [ { - "ownerId": "", - "actorId": "", - "medicationId": "", + "ownerId": "", + "actorId": "", + "medicationId": "", "status": "taken" } ] @@ -65,8 +77,8 @@ "effect": "dispatchMedicationIntakeWebClear", "args": [ { - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-14T08:00:00.000Z", "badgeCount": 2 } @@ -77,7 +89,7 @@ "medications": [ { "id": "", - "userId": "", + "userId": "", "name": "As needed", "dose": "10mg", "treatmentClass": "GENERIC", @@ -111,7 +123,7 @@ }, { "id": "", - "userId": "", + "userId": "", "name": "Record only", "dose": "10mg", "treatmentClass": "GENERIC", @@ -145,7 +157,7 @@ }, { "id": "", - "userId": "", + "userId": "", "name": "Single shot", "dose": "10mg", "treatmentClass": "GENERIC", @@ -178,8 +190,8 @@ "updatedAt": "" }, { - "id": "", - "userId": "", + "id": "", + "userId": "", "name": "Twice daily", "dose": "10mg", "treatmentClass": "GENERIC", @@ -213,7 +225,7 @@ }, { "id": "", - "userId": "", + "userId": "", "name": "Weekly pen", "dose": "10mg", "treatmentClass": "GENERIC", @@ -272,7 +284,7 @@ }, { "id": "", - "medicationId": "", + "medicationId": "", "windowStart": "08:00", "windowEnd": "10:00", "label": null, @@ -332,7 +344,7 @@ }, { "id": "", - "medicationId": "", + "medicationId": "", "windowStart": "20:00", "windowEnd": "22:00", "label": null, @@ -357,8 +369,8 @@ "intakes": [ { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-12T20:00:00.000Z", "takenAt": null, "skipped": true, @@ -378,8 +390,8 @@ }, { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-13T08:00:00.000Z", "takenAt": null, "skipped": false, @@ -399,8 +411,8 @@ }, { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-14T08:00:00.000Z", "takenAt": "2026-10-14T11:00:00.000Z", "skipped": false, @@ -415,7 +427,7 @@ "inventoryConsumption": [ { "units": 1, - "itemId": "" + "itemId": "" } ], "externalId": null, @@ -425,8 +437,8 @@ }, { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-14T20:00:00.000Z", "takenAt": "2026-10-14T20:05:00.000Z", "skipped": false, @@ -446,8 +458,8 @@ }, { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-15T08:00:00.000Z", "takenAt": null, "skipped": true, @@ -467,7 +479,7 @@ }, { "id": "", - "userId": "", + "userId": "", "medicationId": "", "scheduledFor": "2026-10-15T11:00:00.000Z", "takenAt": null, @@ -488,8 +500,8 @@ }, { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-15T20:00:00.000Z", "takenAt": null, "skipped": true, @@ -511,9 +523,9 @@ "doseChanges": [], "inventoryItems": [ { - "id": "", - "userId": "", - "medicationId": "", + "id": "", + "userId": "", + "medicationId": "", "state": "IN_USE", "containerType": "OTHER", "unitsTotal": "30", @@ -536,10 +548,10 @@ "audit": [ { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { - "medicationId": "", + "medicationId": "", "eventId": "", "skipped": false }, @@ -547,7 +559,7 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { "medicationId": "", @@ -558,10 +570,10 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { - "medicationId": "", + "medicationId": "", "eventId": "", "skipped": false }, @@ -569,10 +581,10 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { - "medicationId": "", + "medicationId": "", "eventId": "", "skipped": true }, @@ -580,10 +592,10 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { - "medicationId": "", + "medicationId": "", "eventId": "", "skipped": true }, @@ -591,7 +603,7 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { "medicationId": "", @@ -602,7 +614,7 @@ }, { "action": "medications.intake.update.refused", - "userId": "", + "userId": "", "actorUserId": "", "details": { "medicationId": "", diff --git a/tests/integration/routes/parity/__snapshots__/medication-intake.05-named-backfill.json.snap b/tests/integration/routes/parity/__snapshots__/medication-intake.05-named-backfill.json.snap index ea65b8d16..00581cc79 100644 --- a/tests/integration/routes/parity/__snapshots__/medication-intake.05-named-backfill.json.snap +++ b/tests/integration/routes/parity/__snapshots__/medication-intake.05-named-backfill.json.snap @@ -3,12 +3,24 @@ "body": { "data": { "id": "", + "userId": "", + "medicationId": "", + "scheduledFor": "2026-10-13T08:00:00.000Z", "takenAt": "2026-10-15T11:30:00.000Z", "skipped": false, - "idempotencyKey": null, - "scheduledFor": "2026-10-13T08:00:00.000Z", + "autoMissed": false, + "autoRecorded": false, + "attributionSource": "USER_PIN", "source": "REMINDER", - "createdAt": "" + "idempotencyKey": null, + "createdAt": "", + "injectionSite": null, + "doseTaken": null, + "inventoryConsumption": null, + "externalId": null, + "updatedAt": "", + "syncVersion": "", + "deletedAt": null }, "error": null }, @@ -21,10 +33,10 @@ "entity_id": "" }, "meta": { - "medication_id": "", + "medication_id": "", "units": 1, "item_ids": [ - "" + "" ], "auto_opened": 0, "skipped": false @@ -38,7 +50,7 @@ "effect": "queueMedicationIntakeSync", "args": [ { - "userId": "", + "userId": "", "originDeviceToken": null } ] @@ -46,7 +58,7 @@ { "effect": "countOutstandingDosesToday", "args": [ - "", + "", "UTC" ] }, @@ -54,9 +66,9 @@ "effect": "notifyDelegatedIntake", "args": [ { - "ownerId": "", - "actorId": "", - "medicationId": "", + "ownerId": "", + "actorId": "", + "medicationId": "", "status": "taken" } ] @@ -65,8 +77,8 @@ "effect": "dispatchMedicationIntakeWebClear", "args": [ { - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-13T08:00:00.000Z", "badgeCount": 2 } @@ -77,7 +89,7 @@ "medications": [ { "id": "", - "userId": "", + "userId": "", "name": "As needed", "dose": "10mg", "treatmentClass": "GENERIC", @@ -111,7 +123,7 @@ }, { "id": "", - "userId": "", + "userId": "", "name": "Record only", "dose": "10mg", "treatmentClass": "GENERIC", @@ -145,7 +157,7 @@ }, { "id": "", - "userId": "", + "userId": "", "name": "Single shot", "dose": "10mg", "treatmentClass": "GENERIC", @@ -178,8 +190,8 @@ "updatedAt": "" }, { - "id": "", - "userId": "", + "id": "", + "userId": "", "name": "Twice daily", "dose": "10mg", "treatmentClass": "GENERIC", @@ -213,7 +225,7 @@ }, { "id": "", - "userId": "", + "userId": "", "name": "Weekly pen", "dose": "10mg", "treatmentClass": "GENERIC", @@ -272,7 +284,7 @@ }, { "id": "", - "medicationId": "", + "medicationId": "", "windowStart": "08:00", "windowEnd": "10:00", "label": null, @@ -332,7 +344,7 @@ }, { "id": "", - "medicationId": "", + "medicationId": "", "windowStart": "20:00", "windowEnd": "22:00", "label": null, @@ -357,8 +369,8 @@ "intakes": [ { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-12T20:00:00.000Z", "takenAt": null, "skipped": true, @@ -378,8 +390,8 @@ }, { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-13T08:00:00.000Z", "takenAt": "2026-10-15T11:30:00.000Z", "skipped": false, @@ -394,7 +406,7 @@ "inventoryConsumption": [ { "units": 1, - "itemId": "" + "itemId": "" } ], "externalId": null, @@ -404,8 +416,8 @@ }, { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-14T08:00:00.000Z", "takenAt": "2026-10-14T11:00:00.000Z", "skipped": false, @@ -420,7 +432,7 @@ "inventoryConsumption": [ { "units": 1, - "itemId": "" + "itemId": "" } ], "externalId": null, @@ -430,8 +442,8 @@ }, { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-14T20:00:00.000Z", "takenAt": "2026-10-14T20:05:00.000Z", "skipped": false, @@ -451,8 +463,8 @@ }, { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-15T08:00:00.000Z", "takenAt": null, "skipped": true, @@ -472,7 +484,7 @@ }, { "id": "", - "userId": "", + "userId": "", "medicationId": "", "scheduledFor": "2026-10-15T11:00:00.000Z", "takenAt": null, @@ -493,8 +505,8 @@ }, { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-15T20:00:00.000Z", "takenAt": null, "skipped": true, @@ -516,9 +528,9 @@ "doseChanges": [], "inventoryItems": [ { - "id": "", - "userId": "", - "medicationId": "", + "id": "", + "userId": "", + "medicationId": "", "state": "IN_USE", "containerType": "OTHER", "unitsTotal": "30", @@ -541,10 +553,10 @@ "audit": [ { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { - "medicationId": "", + "medicationId": "", "eventId": "", "skipped": false }, @@ -552,7 +564,7 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { "medicationId": "", @@ -563,10 +575,10 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { - "medicationId": "", + "medicationId": "", "eventId": "", "skipped": false }, @@ -574,10 +586,10 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { - "medicationId": "", + "medicationId": "", "eventId": "", "skipped": false }, @@ -585,10 +597,10 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { - "medicationId": "", + "medicationId": "", "eventId": "", "skipped": true }, @@ -596,10 +608,10 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { - "medicationId": "", + "medicationId": "", "eventId": "", "skipped": true }, @@ -607,7 +619,7 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { "medicationId": "", @@ -618,7 +630,7 @@ }, { "action": "medications.intake.update.refused", - "userId": "", + "userId": "", "actorUserId": "", "details": { "medicationId": "", diff --git a/tests/integration/routes/parity/__snapshots__/medication-intake.06a-body-key.json.snap b/tests/integration/routes/parity/__snapshots__/medication-intake.06a-body-key.json.snap index a5b9e6892..f97aba489 100644 --- a/tests/integration/routes/parity/__snapshots__/medication-intake.06a-body-key.json.snap +++ b/tests/integration/routes/parity/__snapshots__/medication-intake.06a-body-key.json.snap @@ -3,12 +3,24 @@ "body": { "data": { "id": "", + "userId": "", + "medicationId": "", + "scheduledFor": "2026-10-13T20:00:00.000Z", "takenAt": "2026-10-13T20:30:00.000Z", "skipped": false, - "idempotencyKey": "dose-key-0001", - "scheduledFor": "2026-10-13T20:00:00.000Z", + "autoMissed": false, + "autoRecorded": false, + "attributionSource": "AUTO", "source": "WEB", - "createdAt": "" + "idempotencyKey": "dose-key-0001", + "createdAt": "", + "injectionSite": null, + "doseTaken": null, + "inventoryConsumption": null, + "externalId": null, + "updatedAt": "", + "syncVersion": "", + "deletedAt": null }, "error": null }, @@ -21,10 +33,10 @@ "entity_id": "" }, "meta": { - "medication_id": "", + "medication_id": "", "units": 1, "item_ids": [ - "" + "" ], "auto_opened": 0, "skipped": false @@ -38,7 +50,7 @@ "effect": "queueMedicationIntakeSync", "args": [ { - "userId": "", + "userId": "", "originDeviceToken": null } ] @@ -46,7 +58,7 @@ { "effect": "countOutstandingDosesToday", "args": [ - "", + "", "UTC" ] }, @@ -54,9 +66,9 @@ "effect": "notifyDelegatedIntake", "args": [ { - "ownerId": "", - "actorId": "", - "medicationId": "", + "ownerId": "", + "actorId": "", + "medicationId": "", "status": "taken" } ] @@ -65,8 +77,8 @@ "effect": "dispatchMedicationIntakeWebClear", "args": [ { - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-13T20:00:00.000Z", "badgeCount": 2 } @@ -77,7 +89,7 @@ "medications": [ { "id": "", - "userId": "", + "userId": "", "name": "As needed", "dose": "10mg", "treatmentClass": "GENERIC", @@ -111,7 +123,7 @@ }, { "id": "", - "userId": "", + "userId": "", "name": "Record only", "dose": "10mg", "treatmentClass": "GENERIC", @@ -145,7 +157,7 @@ }, { "id": "", - "userId": "", + "userId": "", "name": "Single shot", "dose": "10mg", "treatmentClass": "GENERIC", @@ -178,8 +190,8 @@ "updatedAt": "" }, { - "id": "", - "userId": "", + "id": "", + "userId": "", "name": "Twice daily", "dose": "10mg", "treatmentClass": "GENERIC", @@ -213,7 +225,7 @@ }, { "id": "", - "userId": "", + "userId": "", "name": "Weekly pen", "dose": "10mg", "treatmentClass": "GENERIC", @@ -272,7 +284,7 @@ }, { "id": "", - "medicationId": "", + "medicationId": "", "windowStart": "08:00", "windowEnd": "10:00", "label": null, @@ -332,7 +344,7 @@ }, { "id": "", - "medicationId": "", + "medicationId": "", "windowStart": "20:00", "windowEnd": "22:00", "label": null, @@ -357,8 +369,8 @@ "intakes": [ { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-12T20:00:00.000Z", "takenAt": null, "skipped": true, @@ -378,8 +390,8 @@ }, { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-13T08:00:00.000Z", "takenAt": "2026-10-15T11:30:00.000Z", "skipped": false, @@ -394,7 +406,7 @@ "inventoryConsumption": [ { "units": 1, - "itemId": "" + "itemId": "" } ], "externalId": null, @@ -404,8 +416,8 @@ }, { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-13T20:00:00.000Z", "takenAt": "2026-10-13T20:30:00.000Z", "skipped": false, @@ -420,7 +432,7 @@ "inventoryConsumption": [ { "units": 1, - "itemId": "" + "itemId": "" } ], "externalId": null, @@ -430,8 +442,8 @@ }, { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-14T08:00:00.000Z", "takenAt": "2026-10-14T11:00:00.000Z", "skipped": false, @@ -446,7 +458,7 @@ "inventoryConsumption": [ { "units": 1, - "itemId": "" + "itemId": "" } ], "externalId": null, @@ -456,8 +468,8 @@ }, { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-14T20:00:00.000Z", "takenAt": "2026-10-14T20:05:00.000Z", "skipped": false, @@ -477,8 +489,8 @@ }, { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-15T08:00:00.000Z", "takenAt": null, "skipped": true, @@ -498,7 +510,7 @@ }, { "id": "", - "userId": "", + "userId": "", "medicationId": "", "scheduledFor": "2026-10-15T11:00:00.000Z", "takenAt": null, @@ -519,8 +531,8 @@ }, { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-15T20:00:00.000Z", "takenAt": null, "skipped": true, @@ -542,9 +554,9 @@ "doseChanges": [], "inventoryItems": [ { - "id": "", - "userId": "", - "medicationId": "", + "id": "", + "userId": "", + "medicationId": "", "state": "IN_USE", "containerType": "OTHER", "unitsTotal": "30", @@ -567,10 +579,10 @@ "audit": [ { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { - "medicationId": "", + "medicationId": "", "eventId": "", "skipped": false }, @@ -578,7 +590,7 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { "medicationId": "", @@ -589,10 +601,10 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { - "medicationId": "", + "medicationId": "", "eventId": "", "skipped": false }, @@ -600,10 +612,10 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { - "medicationId": "", + "medicationId": "", "eventId": "", "skipped": false }, @@ -611,10 +623,10 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { - "medicationId": "", + "medicationId": "", "eventId": "", "skipped": false }, @@ -622,10 +634,10 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { - "medicationId": "", + "medicationId": "", "eventId": "", "skipped": true }, @@ -633,10 +645,10 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { - "medicationId": "", + "medicationId": "", "eventId": "", "skipped": true }, @@ -644,7 +656,7 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { "medicationId": "", @@ -655,7 +667,7 @@ }, { "action": "medications.intake.update.refused", - "userId": "", + "userId": "", "actorUserId": "", "details": { "medicationId": "", diff --git a/tests/integration/routes/parity/__snapshots__/medication-intake.07a-header-key.json.snap b/tests/integration/routes/parity/__snapshots__/medication-intake.07a-header-key.json.snap index f4e433b3e..15d1bf5cc 100644 --- a/tests/integration/routes/parity/__snapshots__/medication-intake.07a-header-key.json.snap +++ b/tests/integration/routes/parity/__snapshots__/medication-intake.07a-header-key.json.snap @@ -3,12 +3,24 @@ "body": { "data": { "id": "", + "userId": "", + "medicationId": "", + "scheduledFor": "2026-10-12T08:00:00.000Z", "takenAt": "2026-10-12T08:15:00.000Z", "skipped": false, - "idempotencyKey": null, - "scheduledFor": "2026-10-12T08:00:00.000Z", + "autoMissed": false, + "autoRecorded": false, + "attributionSource": "AUTO", "source": "WEB", - "createdAt": "" + "idempotencyKey": null, + "createdAt": "", + "injectionSite": null, + "doseTaken": null, + "inventoryConsumption": null, + "externalId": null, + "updatedAt": "", + "syncVersion": "", + "deletedAt": null }, "error": null }, @@ -21,10 +33,10 @@ "entity_id": "" }, "meta": { - "medication_id": "", + "medication_id": "", "units": 1, "item_ids": [ - "" + "" ], "auto_opened": 0, "skipped": false @@ -38,7 +50,7 @@ "effect": "queueMedicationIntakeSync", "args": [ { - "userId": "", + "userId": "", "originDeviceToken": null } ] @@ -46,7 +58,7 @@ { "effect": "countOutstandingDosesToday", "args": [ - "", + "", "UTC" ] }, @@ -54,9 +66,9 @@ "effect": "notifyDelegatedIntake", "args": [ { - "ownerId": "", - "actorId": "", - "medicationId": "", + "ownerId": "", + "actorId": "", + "medicationId": "", "status": "taken" } ] @@ -65,8 +77,8 @@ "effect": "dispatchMedicationIntakeWebClear", "args": [ { - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-12T08:00:00.000Z", "badgeCount": 2 } @@ -77,7 +89,7 @@ "medications": [ { "id": "", - "userId": "", + "userId": "", "name": "As needed", "dose": "10mg", "treatmentClass": "GENERIC", @@ -111,7 +123,7 @@ }, { "id": "", - "userId": "", + "userId": "", "name": "Record only", "dose": "10mg", "treatmentClass": "GENERIC", @@ -145,7 +157,7 @@ }, { "id": "", - "userId": "", + "userId": "", "name": "Single shot", "dose": "10mg", "treatmentClass": "GENERIC", @@ -178,8 +190,8 @@ "updatedAt": "" }, { - "id": "", - "userId": "", + "id": "", + "userId": "", "name": "Twice daily", "dose": "10mg", "treatmentClass": "GENERIC", @@ -213,7 +225,7 @@ }, { "id": "", - "userId": "", + "userId": "", "name": "Weekly pen", "dose": "10mg", "treatmentClass": "GENERIC", @@ -272,7 +284,7 @@ }, { "id": "", - "medicationId": "", + "medicationId": "", "windowStart": "08:00", "windowEnd": "10:00", "label": null, @@ -332,7 +344,7 @@ }, { "id": "", - "medicationId": "", + "medicationId": "", "windowStart": "20:00", "windowEnd": "22:00", "label": null, @@ -357,8 +369,8 @@ "intakes": [ { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-12T08:00:00.000Z", "takenAt": "2026-10-12T08:15:00.000Z", "skipped": false, @@ -373,7 +385,7 @@ "inventoryConsumption": [ { "units": 1, - "itemId": "" + "itemId": "" } ], "externalId": null, @@ -383,8 +395,8 @@ }, { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-12T20:00:00.000Z", "takenAt": null, "skipped": true, @@ -404,8 +416,8 @@ }, { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-13T08:00:00.000Z", "takenAt": "2026-10-15T11:30:00.000Z", "skipped": false, @@ -420,7 +432,7 @@ "inventoryConsumption": [ { "units": 1, - "itemId": "" + "itemId": "" } ], "externalId": null, @@ -430,8 +442,8 @@ }, { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-13T20:00:00.000Z", "takenAt": "2026-10-13T20:30:00.000Z", "skipped": false, @@ -446,7 +458,7 @@ "inventoryConsumption": [ { "units": 1, - "itemId": "" + "itemId": "" } ], "externalId": null, @@ -456,8 +468,8 @@ }, { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-14T08:00:00.000Z", "takenAt": "2026-10-14T11:00:00.000Z", "skipped": false, @@ -472,7 +484,7 @@ "inventoryConsumption": [ { "units": 1, - "itemId": "" + "itemId": "" } ], "externalId": null, @@ -482,8 +494,8 @@ }, { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-14T20:00:00.000Z", "takenAt": "2026-10-14T20:05:00.000Z", "skipped": false, @@ -503,8 +515,8 @@ }, { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-15T08:00:00.000Z", "takenAt": null, "skipped": true, @@ -524,7 +536,7 @@ }, { "id": "", - "userId": "", + "userId": "", "medicationId": "", "scheduledFor": "2026-10-15T11:00:00.000Z", "takenAt": null, @@ -545,8 +557,8 @@ }, { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-15T20:00:00.000Z", "takenAt": null, "skipped": true, @@ -568,9 +580,9 @@ "doseChanges": [], "inventoryItems": [ { - "id": "", - "userId": "", - "medicationId": "", + "id": "", + "userId": "", + "medicationId": "", "state": "IN_USE", "containerType": "OTHER", "unitsTotal": "30", @@ -593,10 +605,10 @@ "audit": [ { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { - "medicationId": "", + "medicationId": "", "eventId": "", "skipped": false }, @@ -604,7 +616,7 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { "medicationId": "", @@ -615,10 +627,10 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { - "medicationId": "", + "medicationId": "", "eventId": "", "skipped": false }, @@ -626,10 +638,10 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { - "medicationId": "", + "medicationId": "", "eventId": "", "skipped": false }, @@ -637,10 +649,10 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { - "medicationId": "", + "medicationId": "", "eventId": "", "skipped": false }, @@ -648,10 +660,10 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { - "medicationId": "", + "medicationId": "", "eventId": "", "skipped": false }, @@ -659,10 +671,10 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { - "medicationId": "", + "medicationId": "", "eventId": "", "skipped": true }, @@ -670,10 +682,10 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { - "medicationId": "", + "medicationId": "", "eventId": "", "skipped": true }, @@ -681,7 +693,7 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { "medicationId": "", @@ -692,7 +704,7 @@ }, { "action": "medications.intake.update.refused", - "userId": "", + "userId": "", "actorUserId": "", "details": { "medicationId": "", @@ -703,7 +715,7 @@ ], "idempotency": [ { - "userId": "", + "userId": "", "key": "", "method": "POST", "path": "/api/medications//intake", diff --git a/tests/integration/routes/parity/__snapshots__/medication-intake.07b-header-key-replay.json.snap b/tests/integration/routes/parity/__snapshots__/medication-intake.07b-header-key-replay.json.snap index e66eeed11..a2bab3d76 100644 --- a/tests/integration/routes/parity/__snapshots__/medication-intake.07b-header-key-replay.json.snap +++ b/tests/integration/routes/parity/__snapshots__/medication-intake.07b-header-key-replay.json.snap @@ -3,12 +3,24 @@ "body": { "data": { "id": "", + "userId": "", + "medicationId": "", + "scheduledFor": "2026-10-12T08:00:00.000Z", "takenAt": "2026-10-12T08:15:00.000Z", "skipped": false, - "idempotencyKey": null, - "scheduledFor": "2026-10-12T08:00:00.000Z", + "autoMissed": false, + "autoRecorded": false, + "attributionSource": "AUTO", "source": "WEB", - "createdAt": "" + "idempotencyKey": null, + "createdAt": "", + "injectionSite": null, + "doseTaken": null, + "inventoryConsumption": null, + "externalId": null, + "updatedAt": "", + "syncVersion": "", + "deletedAt": null }, "error": null }, @@ -30,8 +42,8 @@ "stored": { "medications": [ { - "id": "", - "userId": "", + "id": "", + "userId": "", "name": "As needed", "dose": "10mg", "treatmentClass": "GENERIC", @@ -64,8 +76,8 @@ "updatedAt": "" }, { - "id": "", - "userId": "", + "id": "", + "userId": "", "name": "Record only", "dose": "10mg", "treatmentClass": "GENERIC", @@ -98,8 +110,8 @@ "updatedAt": "" }, { - "id": "", - "userId": "", + "id": "", + "userId": "", "name": "Single shot", "dose": "10mg", "treatmentClass": "GENERIC", @@ -132,8 +144,8 @@ "updatedAt": "" }, { - "id": "", - "userId": "", + "id": "", + "userId": "", "name": "Twice daily", "dose": "10mg", "treatmentClass": "GENERIC", @@ -167,7 +179,7 @@ }, { "id": "", - "userId": "", + "userId": "", "name": "Weekly pen", "dose": "10mg", "treatmentClass": "GENERIC", @@ -206,7 +218,7 @@ "schedules": [ { "id": "", - "medicationId": "", + "medicationId": "", "windowStart": "07:00", "windowEnd": "08:00", "label": null, @@ -226,7 +238,7 @@ }, { "id": "", - "medicationId": "", + "medicationId": "", "windowStart": "08:00", "windowEnd": "10:00", "label": null, @@ -266,7 +278,7 @@ }, { "id": "", - "medicationId": "", + "medicationId": "", "windowStart": "09:00", "windowEnd": "11:00", "label": null, @@ -286,7 +298,7 @@ }, { "id": "", - "medicationId": "", + "medicationId": "", "windowStart": "20:00", "windowEnd": "22:00", "label": null, @@ -311,8 +323,8 @@ "intakes": [ { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-12T08:00:00.000Z", "takenAt": "2026-10-12T08:15:00.000Z", "skipped": false, @@ -337,8 +349,8 @@ }, { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-12T20:00:00.000Z", "takenAt": null, "skipped": true, @@ -358,8 +370,8 @@ }, { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-13T08:00:00.000Z", "takenAt": "2026-10-15T11:30:00.000Z", "skipped": false, @@ -384,8 +396,8 @@ }, { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-13T20:00:00.000Z", "takenAt": "2026-10-13T20:30:00.000Z", "skipped": false, @@ -410,8 +422,8 @@ }, { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-14T08:00:00.000Z", "takenAt": "2026-10-14T11:00:00.000Z", "skipped": false, @@ -436,8 +448,8 @@ }, { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-14T20:00:00.000Z", "takenAt": "2026-10-14T20:05:00.000Z", "skipped": false, @@ -457,8 +469,8 @@ }, { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-15T08:00:00.000Z", "takenAt": null, "skipped": true, @@ -478,8 +490,8 @@ }, { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-15T11:00:00.000Z", "takenAt": null, "skipped": true, @@ -499,8 +511,8 @@ }, { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-15T20:00:00.000Z", "takenAt": null, "skipped": true, @@ -523,8 +535,8 @@ "inventoryItems": [ { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "state": "IN_USE", "containerType": "OTHER", "unitsTotal": "30", @@ -547,10 +559,10 @@ "audit": [ { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { - "medicationId": "", + "medicationId": "", "eventId": "", "skipped": false }, @@ -558,10 +570,10 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { - "medicationId": "", + "medicationId": "", "eventId": "", "skipped": false }, @@ -569,10 +581,10 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { - "medicationId": "", + "medicationId": "", "eventId": "", "skipped": false }, @@ -580,10 +592,10 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { - "medicationId": "", + "medicationId": "", "eventId": "", "skipped": false }, @@ -591,10 +603,10 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { - "medicationId": "", + "medicationId": "", "eventId": "", "skipped": false }, @@ -602,10 +614,10 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { - "medicationId": "", + "medicationId": "", "eventId": "", "skipped": false }, @@ -613,10 +625,10 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { - "medicationId": "", + "medicationId": "", "eventId": "", "skipped": true }, @@ -624,10 +636,10 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { - "medicationId": "", + "medicationId": "", "eventId": "", "skipped": true }, @@ -635,10 +647,10 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { - "medicationId": "", + "medicationId": "", "eventId": "", "skipped": true }, @@ -646,10 +658,10 @@ }, { "action": "medications.intake.update.refused", - "userId": "", + "userId": "", "actorUserId": "", "details": { - "medicationId": "", + "medicationId": "", "reason": "resolved_event" }, "ipAddress": null @@ -657,7 +669,7 @@ ], "idempotency": [ { - "userId": "", + "userId": "", "key": "", "method": "POST", "path": "/api/medications//intake", diff --git a/tests/integration/routes/parity/__snapshots__/medication-intake.08-native.json.snap b/tests/integration/routes/parity/__snapshots__/medication-intake.08-native.json.snap index fdc949900..b60ae002d 100644 --- a/tests/integration/routes/parity/__snapshots__/medication-intake.08-native.json.snap +++ b/tests/integration/routes/parity/__snapshots__/medication-intake.08-native.json.snap @@ -3,12 +3,24 @@ "body": { "data": { "id": "", + "userId": "", + "medicationId": "", + "scheduledFor": "2026-10-11T20:00:00.000Z", "takenAt": "2026-10-11T20:10:00.000Z", "skipped": false, - "idempotencyKey": null, - "scheduledFor": "2026-10-11T20:00:00.000Z", + "autoMissed": false, + "autoRecorded": false, + "attributionSource": "AUTO", "source": "API", - "createdAt": "" + "idempotencyKey": null, + "createdAt": "", + "injectionSite": null, + "doseTaken": null, + "inventoryConsumption": null, + "externalId": null, + "updatedAt": "", + "syncVersion": "", + "deletedAt": null }, "error": null }, @@ -21,10 +33,10 @@ "entity_id": "" }, "meta": { - "medication_id": "", + "medication_id": "", "units": 1, "item_ids": [ - "" + "" ], "auto_opened": 0, "skipped": false @@ -38,7 +50,7 @@ "effect": "queueMedicationIntakeSync", "args": [ { - "userId": "", + "userId": "", "originDeviceToken": null } ] @@ -46,7 +58,7 @@ { "effect": "countOutstandingDosesToday", "args": [ - "", + "", "UTC" ] }, @@ -54,9 +66,9 @@ "effect": "notifyDelegatedIntake", "args": [ { - "ownerId": "", - "actorId": "", - "medicationId": "", + "ownerId": "", + "actorId": "", + "medicationId": "", "status": "taken" } ] @@ -65,8 +77,8 @@ "effect": "dispatchMedicationIntakeWebClear", "args": [ { - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-11T20:00:00.000Z", "badgeCount": 2 } @@ -77,7 +89,7 @@ "medications": [ { "id": "", - "userId": "", + "userId": "", "name": "As needed", "dose": "10mg", "treatmentClass": "GENERIC", @@ -111,7 +123,7 @@ }, { "id": "", - "userId": "", + "userId": "", "name": "Record only", "dose": "10mg", "treatmentClass": "GENERIC", @@ -145,7 +157,7 @@ }, { "id": "", - "userId": "", + "userId": "", "name": "Single shot", "dose": "10mg", "treatmentClass": "GENERIC", @@ -178,8 +190,8 @@ "updatedAt": "" }, { - "id": "", - "userId": "", + "id": "", + "userId": "", "name": "Twice daily", "dose": "10mg", "treatmentClass": "GENERIC", @@ -213,7 +225,7 @@ }, { "id": "", - "userId": "", + "userId": "", "name": "Weekly pen", "dose": "10mg", "treatmentClass": "GENERIC", @@ -272,7 +284,7 @@ }, { "id": "", - "medicationId": "", + "medicationId": "", "windowStart": "08:00", "windowEnd": "10:00", "label": null, @@ -332,7 +344,7 @@ }, { "id": "", - "medicationId": "", + "medicationId": "", "windowStart": "20:00", "windowEnd": "22:00", "label": null, @@ -357,8 +369,8 @@ "intakes": [ { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-11T20:00:00.000Z", "takenAt": "2026-10-11T20:10:00.000Z", "skipped": false, @@ -373,7 +385,7 @@ "inventoryConsumption": [ { "units": 1, - "itemId": "" + "itemId": "" } ], "externalId": null, @@ -383,8 +395,8 @@ }, { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-12T08:00:00.000Z", "takenAt": "2026-10-12T08:15:00.000Z", "skipped": false, @@ -399,7 +411,7 @@ "inventoryConsumption": [ { "units": 1, - "itemId": "" + "itemId": "" } ], "externalId": null, @@ -409,8 +421,8 @@ }, { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-12T20:00:00.000Z", "takenAt": null, "skipped": true, @@ -430,8 +442,8 @@ }, { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-13T08:00:00.000Z", "takenAt": "2026-10-15T11:30:00.000Z", "skipped": false, @@ -446,7 +458,7 @@ "inventoryConsumption": [ { "units": 1, - "itemId": "" + "itemId": "" } ], "externalId": null, @@ -456,8 +468,8 @@ }, { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-13T20:00:00.000Z", "takenAt": "2026-10-13T20:30:00.000Z", "skipped": false, @@ -472,7 +484,7 @@ "inventoryConsumption": [ { "units": 1, - "itemId": "" + "itemId": "" } ], "externalId": null, @@ -482,8 +494,8 @@ }, { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-14T08:00:00.000Z", "takenAt": "2026-10-14T11:00:00.000Z", "skipped": false, @@ -498,7 +510,7 @@ "inventoryConsumption": [ { "units": 1, - "itemId": "" + "itemId": "" } ], "externalId": null, @@ -508,8 +520,8 @@ }, { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-14T20:00:00.000Z", "takenAt": "2026-10-14T20:05:00.000Z", "skipped": false, @@ -529,8 +541,8 @@ }, { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-15T08:00:00.000Z", "takenAt": null, "skipped": true, @@ -550,7 +562,7 @@ }, { "id": "", - "userId": "", + "userId": "", "medicationId": "", "scheduledFor": "2026-10-15T11:00:00.000Z", "takenAt": null, @@ -571,8 +583,8 @@ }, { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-15T20:00:00.000Z", "takenAt": null, "skipped": true, @@ -594,9 +606,9 @@ "doseChanges": [], "inventoryItems": [ { - "id": "", - "userId": "", - "medicationId": "", + "id": "", + "userId": "", + "medicationId": "", "state": "IN_USE", "containerType": "OTHER", "unitsTotal": "30", @@ -619,10 +631,10 @@ "audit": [ { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { - "medicationId": "", + "medicationId": "", "eventId": "", "skipped": false }, @@ -630,7 +642,7 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { "medicationId": "", @@ -641,10 +653,10 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { - "medicationId": "", + "medicationId": "", "eventId": "", "skipped": false }, @@ -652,10 +664,10 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { - "medicationId": "", + "medicationId": "", "eventId": "", "skipped": false }, @@ -663,10 +675,10 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { - "medicationId": "", + "medicationId": "", "eventId": "", "skipped": false }, @@ -674,10 +686,10 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { - "medicationId": "", + "medicationId": "", "eventId": "", "skipped": false }, @@ -685,10 +697,10 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { - "medicationId": "", + "medicationId": "", "eventId": "", "skipped": false }, @@ -696,10 +708,10 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { - "medicationId": "", + "medicationId": "", "eventId": "", "skipped": true }, @@ -707,10 +719,10 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { - "medicationId": "", + "medicationId": "", "eventId": "", "skipped": true }, @@ -718,7 +730,7 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { "medicationId": "", @@ -729,7 +741,7 @@ }, { "action": "medications.intake.update.refused", - "userId": "", + "userId": "", "actorUserId": "", "details": { "medicationId": "", @@ -740,7 +752,7 @@ ], "idempotency": [ { - "userId": "", + "userId": "", "key": "", "method": "POST", "path": "/api/medications//intake", diff --git a/tests/integration/routes/parity/__snapshots__/medication-intake.09b-owner-skip-flip.json.snap b/tests/integration/routes/parity/__snapshots__/medication-intake.09b-owner-skip-flip.json.snap index 3b22d87c1..6794d89eb 100644 --- a/tests/integration/routes/parity/__snapshots__/medication-intake.09b-owner-skip-flip.json.snap +++ b/tests/integration/routes/parity/__snapshots__/medication-intake.09b-owner-skip-flip.json.snap @@ -3,12 +3,24 @@ "body": { "data": { "id": "", + "userId": "", + "medicationId": "", + "scheduledFor": "2026-10-14T20:00:00.000Z", "takenAt": null, "skipped": true, - "idempotencyKey": null, - "scheduledFor": "2026-10-14T20:00:00.000Z", + "autoMissed": false, + "autoRecorded": false, + "attributionSource": "AUTO", "source": "WEB", - "createdAt": "" + "idempotencyKey": null, + "createdAt": "", + "injectionSite": null, + "doseTaken": null, + "inventoryConsumption": null, + "externalId": null, + "updatedAt": "", + "syncVersion": "", + "deletedAt": null }, "error": null }, @@ -21,7 +33,7 @@ "entity_id": "" }, "meta": { - "medication_id": "", + "medication_id": "", "skipped": true }, "warnings": null, @@ -33,7 +45,7 @@ "effect": "queueMedicationIntakeSync", "args": [ { - "userId": "", + "userId": "", "originDeviceToken": null } ] @@ -41,7 +53,7 @@ { "effect": "countOutstandingDosesToday", "args": [ - "", + "", "UTC" ] }, @@ -49,9 +61,9 @@ "effect": "notifyDelegatedIntake", "args": [ { - "ownerId": "", - "actorId": "", - "medicationId": "", + "ownerId": "", + "actorId": "", + "medicationId": "", "status": "skipped" } ] @@ -60,8 +72,8 @@ "effect": "dispatchMedicationIntakeWebClear", "args": [ { - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-14T20:00:00.000Z", "badgeCount": 2 } @@ -72,7 +84,7 @@ "medications": [ { "id": "", - "userId": "", + "userId": "", "name": "As needed", "dose": "10mg", "treatmentClass": "GENERIC", @@ -106,7 +118,7 @@ }, { "id": "", - "userId": "", + "userId": "", "name": "Record only", "dose": "10mg", "treatmentClass": "GENERIC", @@ -140,7 +152,7 @@ }, { "id": "", - "userId": "", + "userId": "", "name": "Single shot", "dose": "10mg", "treatmentClass": "GENERIC", @@ -173,8 +185,8 @@ "updatedAt": "" }, { - "id": "", - "userId": "", + "id": "", + "userId": "", "name": "Twice daily", "dose": "10mg", "treatmentClass": "GENERIC", @@ -208,7 +220,7 @@ }, { "id": "", - "userId": "", + "userId": "", "name": "Weekly pen", "dose": "10mg", "treatmentClass": "GENERIC", @@ -267,7 +279,7 @@ }, { "id": "", - "medicationId": "", + "medicationId": "", "windowStart": "08:00", "windowEnd": "10:00", "label": null, @@ -327,7 +339,7 @@ }, { "id": "", - "medicationId": "", + "medicationId": "", "windowStart": "20:00", "windowEnd": "22:00", "label": null, @@ -352,8 +364,8 @@ "intakes": [ { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-11T20:00:00.000Z", "takenAt": "2026-10-11T20:10:00.000Z", "skipped": false, @@ -378,8 +390,8 @@ }, { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-12T08:00:00.000Z", "takenAt": "2026-10-12T08:15:00.000Z", "skipped": false, @@ -404,8 +416,8 @@ }, { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-12T20:00:00.000Z", "takenAt": null, "skipped": true, @@ -425,8 +437,8 @@ }, { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-13T08:00:00.000Z", "takenAt": "2026-10-15T11:30:00.000Z", "skipped": false, @@ -451,8 +463,8 @@ }, { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-13T20:00:00.000Z", "takenAt": "2026-10-13T20:30:00.000Z", "skipped": false, @@ -477,8 +489,8 @@ }, { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-14T08:00:00.000Z", "takenAt": "2026-10-14T11:00:00.000Z", "skipped": false, @@ -503,8 +515,8 @@ }, { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-14T20:00:00.000Z", "takenAt": null, "skipped": true, @@ -524,8 +536,8 @@ }, { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-15T08:00:00.000Z", "takenAt": null, "skipped": true, @@ -545,7 +557,7 @@ }, { "id": "", - "userId": "", + "userId": "", "medicationId": "", "scheduledFor": "2026-10-15T11:00:00.000Z", "takenAt": null, @@ -566,8 +578,8 @@ }, { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-15T20:00:00.000Z", "takenAt": null, "skipped": true, @@ -590,8 +602,8 @@ "inventoryItems": [ { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "state": "IN_USE", "containerType": "OTHER", "unitsTotal": "30", @@ -614,10 +626,10 @@ "audit": [ { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { - "medicationId": "", + "medicationId": "", "eventId": "", "skipped": false }, @@ -625,7 +637,7 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { "medicationId": "", @@ -636,10 +648,10 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { - "medicationId": "", + "medicationId": "", "eventId": "", "skipped": false }, @@ -647,10 +659,10 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { - "medicationId": "", + "medicationId": "", "eventId": "", "skipped": false }, @@ -658,10 +670,10 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { - "medicationId": "", + "medicationId": "", "eventId": "", "skipped": false }, @@ -669,10 +681,10 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { - "medicationId": "", + "medicationId": "", "eventId": "", "skipped": false }, @@ -680,10 +692,10 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { - "medicationId": "", + "medicationId": "", "eventId": "", "skipped": false }, @@ -691,10 +703,10 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { - "medicationId": "", + "medicationId": "", "eventId": "", "skipped": true }, @@ -702,10 +714,10 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { - "medicationId": "", + "medicationId": "", "eventId": "", "skipped": true }, @@ -713,7 +725,7 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { "medicationId": "", @@ -724,10 +736,10 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { - "medicationId": "", + "medicationId": "", "eventId": "", "skipped": true }, @@ -735,7 +747,7 @@ }, { "action": "medications.intake.update.refused", - "userId": "", + "userId": "", "actorUserId": "", "details": { "medicationId": "", @@ -745,10 +757,10 @@ }, { "action": "medications.intake.update.refused", - "userId": "", + "userId": "", "actorUserId": "", "details": { - "medicationId": "", + "medicationId": "", "reason": "resolved_event" }, "ipAddress": null @@ -756,7 +768,7 @@ ], "idempotency": [ { - "userId": "", + "userId": "", "key": "", "method": "POST", "path": "/api/medications//intake", diff --git a/tests/integration/routes/parity/__snapshots__/medication-intake.10a-writer-take.json.snap b/tests/integration/routes/parity/__snapshots__/medication-intake.10a-writer-take.json.snap index 30e91414f..c4053484a 100644 --- a/tests/integration/routes/parity/__snapshots__/medication-intake.10a-writer-take.json.snap +++ b/tests/integration/routes/parity/__snapshots__/medication-intake.10a-writer-take.json.snap @@ -3,12 +3,24 @@ "body": { "data": { "id": "", + "userId": "", + "medicationId": "", + "scheduledFor": "2026-10-11T08:00:00.000Z", "takenAt": "2026-10-11T08:20:00.000Z", "skipped": false, - "idempotencyKey": null, - "scheduledFor": "2026-10-11T08:00:00.000Z", + "autoMissed": false, + "autoRecorded": false, + "attributionSource": "AUTO", "source": "WEB", - "createdAt": "" + "idempotencyKey": null, + "createdAt": "", + "injectionSite": null, + "doseTaken": null, + "inventoryConsumption": null, + "externalId": null, + "updatedAt": "", + "syncVersion": "", + "deletedAt": null }, "error": null }, @@ -21,10 +33,10 @@ "entity_id": "" }, "meta": { - "medication_id": "", + "medication_id": "", "units": 1, "item_ids": [ - "" + "" ], "auto_opened": 0, "skipped": false @@ -38,7 +50,7 @@ "effect": "queueMedicationIntakeSync", "args": [ { - "userId": "", + "userId": "", "originDeviceToken": null } ] @@ -46,7 +58,7 @@ { "effect": "countOutstandingDosesToday", "args": [ - "", + "", "UTC" ] }, @@ -54,9 +66,9 @@ "effect": "notifyDelegatedIntake", "args": [ { - "ownerId": "", + "ownerId": "", "actorId": "", - "medicationId": "", + "medicationId": "", "status": "taken" } ] @@ -65,8 +77,8 @@ "effect": "dispatchMedicationIntakeWebClear", "args": [ { - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-11T08:00:00.000Z", "badgeCount": 2 } @@ -77,7 +89,7 @@ "medications": [ { "id": "", - "userId": "", + "userId": "", "name": "As needed", "dose": "10mg", "treatmentClass": "GENERIC", @@ -111,7 +123,7 @@ }, { "id": "", - "userId": "", + "userId": "", "name": "Record only", "dose": "10mg", "treatmentClass": "GENERIC", @@ -145,7 +157,7 @@ }, { "id": "", - "userId": "", + "userId": "", "name": "Single shot", "dose": "10mg", "treatmentClass": "GENERIC", @@ -178,8 +190,8 @@ "updatedAt": "" }, { - "id": "", - "userId": "", + "id": "", + "userId": "", "name": "Twice daily", "dose": "10mg", "treatmentClass": "GENERIC", @@ -213,7 +225,7 @@ }, { "id": "", - "userId": "", + "userId": "", "name": "Weekly pen", "dose": "10mg", "treatmentClass": "GENERIC", @@ -272,7 +284,7 @@ }, { "id": "", - "medicationId": "", + "medicationId": "", "windowStart": "08:00", "windowEnd": "10:00", "label": null, @@ -332,7 +344,7 @@ }, { "id": "", - "medicationId": "", + "medicationId": "", "windowStart": "20:00", "windowEnd": "22:00", "label": null, @@ -357,8 +369,8 @@ "intakes": [ { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-11T08:00:00.000Z", "takenAt": "2026-10-11T08:20:00.000Z", "skipped": false, @@ -373,7 +385,7 @@ "inventoryConsumption": [ { "units": 1, - "itemId": "" + "itemId": "" } ], "externalId": null, @@ -383,8 +395,8 @@ }, { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-11T20:00:00.000Z", "takenAt": "2026-10-11T20:10:00.000Z", "skipped": false, @@ -399,7 +411,7 @@ "inventoryConsumption": [ { "units": 1, - "itemId": "" + "itemId": "" } ], "externalId": null, @@ -409,8 +421,8 @@ }, { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-12T08:00:00.000Z", "takenAt": "2026-10-12T08:15:00.000Z", "skipped": false, @@ -425,7 +437,7 @@ "inventoryConsumption": [ { "units": 1, - "itemId": "" + "itemId": "" } ], "externalId": null, @@ -435,8 +447,8 @@ }, { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-12T20:00:00.000Z", "takenAt": null, "skipped": true, @@ -456,8 +468,8 @@ }, { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-13T08:00:00.000Z", "takenAt": "2026-10-15T11:30:00.000Z", "skipped": false, @@ -472,7 +484,7 @@ "inventoryConsumption": [ { "units": 1, - "itemId": "" + "itemId": "" } ], "externalId": null, @@ -482,8 +494,8 @@ }, { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-13T20:00:00.000Z", "takenAt": "2026-10-13T20:30:00.000Z", "skipped": false, @@ -498,7 +510,7 @@ "inventoryConsumption": [ { "units": 1, - "itemId": "" + "itemId": "" } ], "externalId": null, @@ -508,8 +520,8 @@ }, { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-14T08:00:00.000Z", "takenAt": "2026-10-14T11:00:00.000Z", "skipped": false, @@ -524,7 +536,7 @@ "inventoryConsumption": [ { "units": 1, - "itemId": "" + "itemId": "" } ], "externalId": null, @@ -534,8 +546,8 @@ }, { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-14T20:00:00.000Z", "takenAt": null, "skipped": true, @@ -555,8 +567,8 @@ }, { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-15T08:00:00.000Z", "takenAt": null, "skipped": true, @@ -576,7 +588,7 @@ }, { "id": "", - "userId": "", + "userId": "", "medicationId": "", "scheduledFor": "2026-10-15T11:00:00.000Z", "takenAt": null, @@ -597,8 +609,8 @@ }, { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-15T20:00:00.000Z", "takenAt": null, "skipped": true, @@ -620,9 +632,9 @@ "doseChanges": [], "inventoryItems": [ { - "id": "", - "userId": "", - "medicationId": "", + "id": "", + "userId": "", + "medicationId": "", "state": "IN_USE", "containerType": "OTHER", "unitsTotal": "30", @@ -645,10 +657,10 @@ "audit": [ { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": "", "details": { - "medicationId": "", + "medicationId": "", "eventId": "", "skipped": false }, @@ -656,10 +668,10 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { - "medicationId": "", + "medicationId": "", "eventId": "", "skipped": false }, @@ -667,7 +679,7 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { "medicationId": "", @@ -678,10 +690,10 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { - "medicationId": "", + "medicationId": "", "eventId": "", "skipped": false }, @@ -689,10 +701,10 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { - "medicationId": "", + "medicationId": "", "eventId": "", "skipped": false }, @@ -700,10 +712,10 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { - "medicationId": "", + "medicationId": "", "eventId": "", "skipped": false }, @@ -711,10 +723,10 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { - "medicationId": "", + "medicationId": "", "eventId": "", "skipped": false }, @@ -722,10 +734,10 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { - "medicationId": "", + "medicationId": "", "eventId": "", "skipped": false }, @@ -733,10 +745,10 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { - "medicationId": "", + "medicationId": "", "eventId": "", "skipped": true }, @@ -744,10 +756,10 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { - "medicationId": "", + "medicationId": "", "eventId": "", "skipped": true }, @@ -755,7 +767,7 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { "medicationId": "", @@ -766,10 +778,10 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { - "medicationId": "", + "medicationId": "", "eventId": "", "skipped": true }, @@ -777,7 +789,7 @@ }, { "action": "medications.intake.update.refused", - "userId": "", + "userId": "", "actorUserId": "", "details": { "medicationId": "", @@ -787,10 +799,10 @@ }, { "action": "medications.intake.update.refused", - "userId": "", + "userId": "", "actorUserId": "", "details": { - "medicationId": "", + "medicationId": "", "reason": "resolved_event" }, "ipAddress": null @@ -798,7 +810,7 @@ ], "idempotency": [ { - "userId": "", + "userId": "", "key": "", "method": "POST", "path": "/api/medications//intake", diff --git a/tests/integration/routes/parity/__snapshots__/medication-intake.11b-site-and-dose.json.snap b/tests/integration/routes/parity/__snapshots__/medication-intake.11b-site-and-dose.json.snap index 8c3e32ca8..6ac1a2a5d 100644 --- a/tests/integration/routes/parity/__snapshots__/medication-intake.11b-site-and-dose.json.snap +++ b/tests/integration/routes/parity/__snapshots__/medication-intake.11b-site-and-dose.json.snap @@ -3,12 +3,24 @@ "body": { "data": { "id": "", + "userId": "", + "medicationId": "", + "scheduledFor": "2026-10-15T09:00:00.000Z", "takenAt": "2026-10-15T09:10:00.000Z", "skipped": false, - "idempotencyKey": null, - "scheduledFor": "2026-10-15T09:00:00.000Z", + "autoMissed": false, + "autoRecorded": false, + "attributionSource": "AUTO", "source": "WEB", - "createdAt": "" + "idempotencyKey": null, + "createdAt": "", + "injectionSite": "ABDOMEN_LEFT", + "doseTaken": "0.5 pen", + "inventoryConsumption": null, + "externalId": null, + "updatedAt": "", + "syncVersion": "", + "deletedAt": null }, "error": null }, @@ -21,7 +33,7 @@ "entity_id": "" }, "meta": { - "medication_id": "", + "medication_id": "", "units": 0, "item_ids": [], "auto_opened": 0, @@ -36,7 +48,7 @@ "effect": "queueMedicationIntakeSync", "args": [ { - "userId": "", + "userId": "", "originDeviceToken": null } ] @@ -44,7 +56,7 @@ { "effect": "countOutstandingDosesToday", "args": [ - "", + "", "UTC" ] }, @@ -52,9 +64,9 @@ "effect": "notifyDelegatedIntake", "args": [ { - "ownerId": "", - "actorId": "", - "medicationId": "", + "ownerId": "", + "actorId": "", + "medicationId": "", "status": "taken" } ] @@ -63,8 +75,8 @@ "effect": "dispatchMedicationIntakeWebClear", "args": [ { - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-15T09:00:00.000Z", "badgeCount": 2 } @@ -75,7 +87,7 @@ "medications": [ { "id": "", - "userId": "", + "userId": "", "name": "As needed", "dose": "10mg", "treatmentClass": "GENERIC", @@ -109,7 +121,7 @@ }, { "id": "", - "userId": "", + "userId": "", "name": "Record only", "dose": "10mg", "treatmentClass": "GENERIC", @@ -143,7 +155,7 @@ }, { "id": "", - "userId": "", + "userId": "", "name": "Single shot", "dose": "10mg", "treatmentClass": "GENERIC", @@ -177,7 +189,7 @@ }, { "id": "", - "userId": "", + "userId": "", "name": "Twice daily", "dose": "10mg", "treatmentClass": "GENERIC", @@ -210,8 +222,8 @@ "updatedAt": "" }, { - "id": "", - "userId": "", + "id": "", + "userId": "", "name": "Weekly pen", "dose": "10mg", "treatmentClass": "GENERIC", @@ -290,7 +302,7 @@ }, { "id": "", - "medicationId": "", + "medicationId": "", "windowStart": "09:00", "windowEnd": "11:00", "label": null, @@ -355,7 +367,7 @@ "intakes": [ { "id": "", - "userId": "", + "userId": "", "medicationId": "", "scheduledFor": "2026-10-11T08:00:00.000Z", "takenAt": "2026-10-11T08:20:00.000Z", @@ -381,7 +393,7 @@ }, { "id": "", - "userId": "", + "userId": "", "medicationId": "", "scheduledFor": "2026-10-11T20:00:00.000Z", "takenAt": "2026-10-11T20:10:00.000Z", @@ -407,7 +419,7 @@ }, { "id": "", - "userId": "", + "userId": "", "medicationId": "", "scheduledFor": "2026-10-12T08:00:00.000Z", "takenAt": "2026-10-12T08:15:00.000Z", @@ -433,7 +445,7 @@ }, { "id": "", - "userId": "", + "userId": "", "medicationId": "", "scheduledFor": "2026-10-12T20:00:00.000Z", "takenAt": null, @@ -454,7 +466,7 @@ }, { "id": "", - "userId": "", + "userId": "", "medicationId": "", "scheduledFor": "2026-10-13T08:00:00.000Z", "takenAt": "2026-10-15T11:30:00.000Z", @@ -480,7 +492,7 @@ }, { "id": "", - "userId": "", + "userId": "", "medicationId": "", "scheduledFor": "2026-10-13T20:00:00.000Z", "takenAt": "2026-10-13T20:30:00.000Z", @@ -506,7 +518,7 @@ }, { "id": "", - "userId": "", + "userId": "", "medicationId": "", "scheduledFor": "2026-10-14T08:00:00.000Z", "takenAt": "2026-10-14T11:00:00.000Z", @@ -532,7 +544,7 @@ }, { "id": "", - "userId": "", + "userId": "", "medicationId": "", "scheduledFor": "2026-10-14T20:00:00.000Z", "takenAt": null, @@ -553,7 +565,7 @@ }, { "id": "", - "userId": "", + "userId": "", "medicationId": "", "scheduledFor": "2026-10-15T08:00:00.000Z", "takenAt": null, @@ -574,8 +586,8 @@ }, { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-15T09:00:00.000Z", "takenAt": "2026-10-15T09:10:00.000Z", "skipped": false, @@ -595,7 +607,7 @@ }, { "id": "", - "userId": "", + "userId": "", "medicationId": "", "scheduledFor": "2026-10-15T11:00:00.000Z", "takenAt": null, @@ -616,7 +628,7 @@ }, { "id": "", - "userId": "", + "userId": "", "medicationId": "", "scheduledFor": "2026-10-15T20:00:00.000Z", "takenAt": null, @@ -640,7 +652,7 @@ "inventoryItems": [ { "id": "", - "userId": "", + "userId": "", "medicationId": "", "state": "IN_USE", "containerType": "OTHER", @@ -664,7 +676,7 @@ "audit": [ { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": "", "details": { "medicationId": "", @@ -675,7 +687,7 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { "medicationId": "", @@ -686,7 +698,7 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { "medicationId": "", @@ -697,7 +709,7 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { "medicationId": "", @@ -708,7 +720,7 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { "medicationId": "", @@ -719,7 +731,7 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { "medicationId": "", @@ -730,7 +742,7 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { "medicationId": "", @@ -741,7 +753,7 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { "medicationId": "", @@ -752,10 +764,10 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { - "medicationId": "", + "medicationId": "", "eventId": "", "skipped": false }, @@ -763,7 +775,7 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { "medicationId": "", @@ -774,7 +786,7 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { "medicationId": "", @@ -785,7 +797,7 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { "medicationId": "", @@ -796,7 +808,7 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { "medicationId": "", @@ -807,7 +819,7 @@ }, { "action": "medications.intake.update.refused", - "userId": "", + "userId": "", "actorUserId": "", "details": { "medicationId": "", @@ -817,7 +829,7 @@ }, { "action": "medications.intake.update.refused", - "userId": "", + "userId": "", "actorUserId": "", "details": { "medicationId": "", @@ -828,7 +840,7 @@ ], "idempotency": [ { - "userId": "", + "userId": "", "key": "", "method": "POST", "path": "/api/medications//intake", diff --git a/tests/integration/routes/parity/__snapshots__/medication-intake.12-one-shot.json.snap b/tests/integration/routes/parity/__snapshots__/medication-intake.12-one-shot.json.snap index 07271f7b7..034101fed 100644 --- a/tests/integration/routes/parity/__snapshots__/medication-intake.12-one-shot.json.snap +++ b/tests/integration/routes/parity/__snapshots__/medication-intake.12-one-shot.json.snap @@ -3,12 +3,24 @@ "body": { "data": { "id": "", + "userId": "", + "medicationId": "", + "scheduledFor": "2026-10-15T09:00:00.000Z", "takenAt": "2026-10-15T10:00:00.000Z", "skipped": false, - "idempotencyKey": null, - "scheduledFor": "2026-10-15T09:00:00.000Z", + "autoMissed": false, + "autoRecorded": false, + "attributionSource": "AUTO", "source": "WEB", - "createdAt": "" + "idempotencyKey": null, + "createdAt": "", + "injectionSite": null, + "doseTaken": null, + "inventoryConsumption": null, + "externalId": null, + "updatedAt": "", + "syncVersion": "", + "deletedAt": null }, "error": null }, @@ -19,7 +31,7 @@ "name": "medication.oneShot.reconciled" }, "meta": { - "medication_id": "", + "medication_id": "", "units": 0, "item_ids": [], "auto_opened": 0, @@ -35,7 +47,7 @@ "effect": "queueMedicationIntakeSync", "args": [ { - "userId": "", + "userId": "", "originDeviceToken": null } ] @@ -43,7 +55,7 @@ { "effect": "countOutstandingDosesToday", "args": [ - "", + "", "UTC" ] }, @@ -51,9 +63,9 @@ "effect": "notifyDelegatedIntake", "args": [ { - "ownerId": "", - "actorId": "", - "medicationId": "", + "ownerId": "", + "actorId": "", + "medicationId": "", "status": "taken" } ] @@ -62,8 +74,8 @@ "effect": "dispatchMedicationIntakeWebClear", "args": [ { - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-15T09:00:00.000Z", "badgeCount": 2 } @@ -74,7 +86,7 @@ "medications": [ { "id": "", - "userId": "", + "userId": "", "name": "As needed", "dose": "10mg", "treatmentClass": "GENERIC", @@ -108,7 +120,7 @@ }, { "id": "", - "userId": "", + "userId": "", "name": "Record only", "dose": "10mg", "treatmentClass": "GENERIC", @@ -141,8 +153,8 @@ "updatedAt": "" }, { - "id": "", - "userId": "", + "id": "", + "userId": "", "name": "Single shot", "dose": "10mg", "treatmentClass": "GENERIC", @@ -176,7 +188,7 @@ }, { "id": "", - "userId": "", + "userId": "", "name": "Twice daily", "dose": "10mg", "treatmentClass": "GENERIC", @@ -210,7 +222,7 @@ }, { "id": "", - "userId": "", + "userId": "", "name": "Weekly pen", "dose": "10mg", "treatmentClass": "GENERIC", @@ -309,7 +321,7 @@ }, { "id": "", - "medicationId": "", + "medicationId": "", "windowStart": "09:00", "windowEnd": "11:00", "label": null, @@ -354,7 +366,7 @@ "intakes": [ { "id": "", - "userId": "", + "userId": "", "medicationId": "", "scheduledFor": "2026-10-11T08:00:00.000Z", "takenAt": "2026-10-11T08:20:00.000Z", @@ -380,7 +392,7 @@ }, { "id": "", - "userId": "", + "userId": "", "medicationId": "", "scheduledFor": "2026-10-11T20:00:00.000Z", "takenAt": "2026-10-11T20:10:00.000Z", @@ -406,7 +418,7 @@ }, { "id": "", - "userId": "", + "userId": "", "medicationId": "", "scheduledFor": "2026-10-12T08:00:00.000Z", "takenAt": "2026-10-12T08:15:00.000Z", @@ -432,7 +444,7 @@ }, { "id": "", - "userId": "", + "userId": "", "medicationId": "", "scheduledFor": "2026-10-12T20:00:00.000Z", "takenAt": null, @@ -453,7 +465,7 @@ }, { "id": "", - "userId": "", + "userId": "", "medicationId": "", "scheduledFor": "2026-10-13T08:00:00.000Z", "takenAt": "2026-10-15T11:30:00.000Z", @@ -479,7 +491,7 @@ }, { "id": "", - "userId": "", + "userId": "", "medicationId": "", "scheduledFor": "2026-10-13T20:00:00.000Z", "takenAt": "2026-10-13T20:30:00.000Z", @@ -505,7 +517,7 @@ }, { "id": "", - "userId": "", + "userId": "", "medicationId": "", "scheduledFor": "2026-10-14T08:00:00.000Z", "takenAt": "2026-10-14T11:00:00.000Z", @@ -531,7 +543,7 @@ }, { "id": "", - "userId": "", + "userId": "", "medicationId": "", "scheduledFor": "2026-10-14T20:00:00.000Z", "takenAt": null, @@ -552,7 +564,7 @@ }, { "id": "", - "userId": "", + "userId": "", "medicationId": "", "scheduledFor": "2026-10-15T08:00:00.000Z", "takenAt": null, @@ -573,7 +585,7 @@ }, { "id": "", - "userId": "", + "userId": "", "medicationId": "", "scheduledFor": "2026-10-15T09:00:00.000Z", "takenAt": "2026-10-15T09:10:00.000Z", @@ -594,8 +606,8 @@ }, { "id": "", - "userId": "", - "medicationId": "", + "userId": "", + "medicationId": "", "scheduledFor": "2026-10-15T09:00:00.000Z", "takenAt": "2026-10-15T10:00:00.000Z", "skipped": false, @@ -615,7 +627,7 @@ }, { "id": "", - "userId": "", + "userId": "", "medicationId": "", "scheduledFor": "2026-10-15T11:00:00.000Z", "takenAt": null, @@ -636,7 +648,7 @@ }, { "id": "", - "userId": "", + "userId": "", "medicationId": "", "scheduledFor": "2026-10-15T20:00:00.000Z", "takenAt": null, @@ -660,7 +672,7 @@ "inventoryItems": [ { "id": "", - "userId": "", + "userId": "", "medicationId": "", "state": "IN_USE", "containerType": "OTHER", @@ -684,7 +696,7 @@ "audit": [ { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": "", "details": { "medicationId": "", @@ -695,7 +707,7 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { "medicationId": "", @@ -706,7 +718,7 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { "medicationId": "", @@ -717,7 +729,7 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { "medicationId": "", @@ -728,7 +740,7 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { "medicationId": "", @@ -739,7 +751,7 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { "medicationId": "", @@ -750,7 +762,7 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { "medicationId": "", @@ -761,7 +773,7 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { "medicationId": "", @@ -772,7 +784,7 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { "medicationId": "", @@ -783,10 +795,10 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { - "medicationId": "", + "medicationId": "", "eventId": "", "skipped": false }, @@ -794,7 +806,7 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { "medicationId": "", @@ -805,7 +817,7 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { "medicationId": "", @@ -816,7 +828,7 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { "medicationId": "", @@ -827,7 +839,7 @@ }, { "action": "medication.intake", - "userId": "", + "userId": "", "actorUserId": null, "details": { "medicationId": "", @@ -838,17 +850,17 @@ }, { "action": "medication.oneShot.reconciled", - "userId": "", + "userId": "", "actorUserId": null, "details": { - "medicationId": "", + "medicationId": "", "action": "deactivate" }, "ipAddress": null }, { "action": "medications.intake.update.refused", - "userId": "", + "userId": "", "actorUserId": "", "details": { "medicationId": "", @@ -858,7 +870,7 @@ }, { "action": "medications.intake.update.refused", - "userId": "", + "userId": "", "actorUserId": "", "details": { "medicationId": "", @@ -869,7 +881,7 @@ ], "idempotency": [ { - "userId": "", + "userId": "", "key": "", "method": "POST", "path": "/api/medications//intake", diff --git a/tests/integration/routes/parity/__snapshots__/medications.11-plain.json.snap b/tests/integration/routes/parity/__snapshots__/medications.11-plain.json.snap index 8882ea379..42f544ad5 100644 --- a/tests/integration/routes/parity/__snapshots__/medications.11-plain.json.snap +++ b/tests/integration/routes/parity/__snapshots__/medications.11-plain.json.snap @@ -62,7 +62,17 @@ "courses": [], "courseCount": 0, "previousCourseEndedOn": null, - "canStartCourse": false + "canStartCourse": false, + "nextDueAt": "2026-10-16T05:00:00.000Z", + "remindersActive": true, + "nextDueOverdue": false, + "courseStatus": "CURRENT", + "intakeActionable": true, + "stockUnitsRemaining": null, + "stockDosesRemaining": null, + "runwayDays": null, + "ingredients": [], + "related": [] }, "error": null }, diff --git a/tests/integration/routes/parity/__snapshots__/medications.12-full.json.snap b/tests/integration/routes/parity/__snapshots__/medications.12-full.json.snap index 24775d467..9a4f14354 100644 --- a/tests/integration/routes/parity/__snapshots__/medications.12-full.json.snap +++ b/tests/integration/routes/parity/__snapshots__/medications.12-full.json.snap @@ -80,7 +80,17 @@ ], "courseCount": 1, "previousCourseEndedOn": null, - "canStartCourse": false + "canStartCourse": false, + "nextDueAt": "2026-10-12T16:30:00.000Z", + "remindersActive": false, + "nextDueOverdue": true, + "courseStatus": "CURRENT", + "intakeActionable": true, + "stockUnitsRemaining": null, + "stockDosesRemaining": null, + "runwayDays": null, + "ingredients": [], + "related": [] }, "error": null }, diff --git a/tests/integration/routes/parity/__snapshots__/medications.13a-as-needed.json.snap b/tests/integration/routes/parity/__snapshots__/medications.13a-as-needed.json.snap index c23aca305..f3a3616bd 100644 --- a/tests/integration/routes/parity/__snapshots__/medications.13a-as-needed.json.snap +++ b/tests/integration/routes/parity/__snapshots__/medications.13a-as-needed.json.snap @@ -40,7 +40,17 @@ "courses": [], "courseCount": 0, "previousCourseEndedOn": null, - "canStartCourse": false + "canStartCourse": false, + "nextDueAt": null, + "remindersActive": false, + "nextDueOverdue": false, + "courseStatus": "CURRENT", + "intakeActionable": true, + "stockUnitsRemaining": null, + "stockDosesRemaining": null, + "runwayDays": null, + "ingredients": [], + "related": [] }, "error": null }, diff --git a/tests/integration/routes/parity/__snapshots__/medications.13b-one-shot.json.snap b/tests/integration/routes/parity/__snapshots__/medications.13b-one-shot.json.snap index a43296040..e90f7436b 100644 --- a/tests/integration/routes/parity/__snapshots__/medications.13b-one-shot.json.snap +++ b/tests/integration/routes/parity/__snapshots__/medications.13b-one-shot.json.snap @@ -71,7 +71,17 @@ ], "courseCount": 1, "previousCourseEndedOn": null, - "canStartCourse": false + "canStartCourse": false, + "nextDueAt": "2026-10-20T07:00:00.000Z", + "remindersActive": true, + "nextDueOverdue": false, + "courseStatus": "UPCOMING", + "intakeActionable": false, + "stockUnitsRemaining": null, + "stockDosesRemaining": null, + "runwayDays": null, + "ingredients": [], + "related": [] }, "error": null }, diff --git a/tests/integration/routes/parity/__snapshots__/medications.13c-prn-and-legacy-days.json.snap b/tests/integration/routes/parity/__snapshots__/medications.13c-prn-and-legacy-days.json.snap index 81a5f1d0c..70bc8174e 100644 --- a/tests/integration/routes/parity/__snapshots__/medications.13c-prn-and-legacy-days.json.snap +++ b/tests/integration/routes/parity/__snapshots__/medications.13c-prn-and-legacy-days.json.snap @@ -105,7 +105,17 @@ "courses": [], "courseCount": 0, "previousCourseEndedOn": null, - "canStartCourse": false + "canStartCourse": false, + "nextDueAt": null, + "remindersActive": false, + "nextDueOverdue": false, + "courseStatus": "CURRENT", + "intakeActionable": false, + "stockUnitsRemaining": null, + "stockDosesRemaining": null, + "runwayDays": null, + "ingredients": [], + "related": [] }, "error": null }, diff --git a/tests/integration/routes/parity/__snapshots__/medications.13d-ended-window.json.snap b/tests/integration/routes/parity/__snapshots__/medications.13d-ended-window.json.snap index b12f37c1b..6c2a8d479 100644 --- a/tests/integration/routes/parity/__snapshots__/medications.13d-ended-window.json.snap +++ b/tests/integration/routes/parity/__snapshots__/medications.13d-ended-window.json.snap @@ -71,7 +71,17 @@ ], "courseCount": 1, "previousCourseEndedOn": "2026-10-05", - "canStartCourse": true + "canStartCourse": true, + "nextDueAt": null, + "remindersActive": false, + "nextDueOverdue": false, + "courseStatus": "ENDED", + "intakeActionable": false, + "stockUnitsRemaining": null, + "stockDosesRemaining": null, + "runwayDays": null, + "ingredients": [], + "related": [] }, "error": null }, diff --git a/tests/integration/routes/parity/__snapshots__/medications.15a-mirror.json.snap b/tests/integration/routes/parity/__snapshots__/medications.15a-mirror.json.snap index 302f69f2d..5b84cf296 100644 --- a/tests/integration/routes/parity/__snapshots__/medications.15a-mirror.json.snap +++ b/tests/integration/routes/parity/__snapshots__/medications.15a-mirror.json.snap @@ -62,7 +62,17 @@ "courses": [], "courseCount": 0, "previousCourseEndedOn": null, - "canStartCourse": false + "canStartCourse": false, + "nextDueAt": "2026-10-16T06:00:00.000Z", + "remindersActive": true, + "nextDueOverdue": false, + "courseStatus": "CURRENT", + "intakeActionable": true, + "stockUnitsRemaining": null, + "stockDosesRemaining": null, + "runwayDays": null, + "ingredients": [], + "related": [] }, "error": null }, diff --git a/tests/integration/routes/parity/__snapshots__/medications.15b-mirror-replay.json.snap b/tests/integration/routes/parity/__snapshots__/medications.15b-mirror-replay.json.snap index 25c308749..ca1c2c536 100644 --- a/tests/integration/routes/parity/__snapshots__/medications.15b-mirror-replay.json.snap +++ b/tests/integration/routes/parity/__snapshots__/medications.15b-mirror-replay.json.snap @@ -58,7 +58,21 @@ } ], "category": "OTHER", - "categoryLabel": null + "categoryLabel": null, + "courses": [], + "courseCount": 0, + "previousCourseEndedOn": null, + "canStartCourse": false, + "nextDueAt": "2026-10-16T06:00:00.000Z", + "remindersActive": true, + "nextDueOverdue": false, + "courseStatus": "CURRENT", + "intakeActionable": true, + "stockUnitsRemaining": null, + "stockDosesRemaining": null, + "runwayDays": null, + "ingredients": [], + "related": [] }, "error": null }, diff --git a/tests/integration/routes/parity/__snapshots__/medications.17a-idempotent-first.json.snap b/tests/integration/routes/parity/__snapshots__/medications.17a-idempotent-first.json.snap index d6d186d9a..075912d7f 100644 --- a/tests/integration/routes/parity/__snapshots__/medications.17a-idempotent-first.json.snap +++ b/tests/integration/routes/parity/__snapshots__/medications.17a-idempotent-first.json.snap @@ -62,7 +62,17 @@ "courses": [], "courseCount": 0, "previousCourseEndedOn": null, - "canStartCourse": false + "canStartCourse": false, + "nextDueAt": "2026-10-16T06:00:00.000Z", + "remindersActive": true, + "nextDueOverdue": false, + "courseStatus": "CURRENT", + "intakeActionable": true, + "stockUnitsRemaining": null, + "stockDosesRemaining": null, + "runwayDays": null, + "ingredients": [], + "related": [] }, "error": null }, diff --git a/tests/integration/routes/parity/__snapshots__/medications.17b-idempotent-replay.json.snap b/tests/integration/routes/parity/__snapshots__/medications.17b-idempotent-replay.json.snap index 478f992f5..b2041d2c4 100644 --- a/tests/integration/routes/parity/__snapshots__/medications.17b-idempotent-replay.json.snap +++ b/tests/integration/routes/parity/__snapshots__/medications.17b-idempotent-replay.json.snap @@ -62,7 +62,17 @@ "courses": [], "courseCount": 0, "previousCourseEndedOn": null, - "canStartCourse": false + "canStartCourse": false, + "nextDueAt": "2026-10-16T06:00:00.000Z", + "remindersActive": true, + "nextDueOverdue": false, + "courseStatus": "CURRENT", + "intakeActionable": true, + "stockUnitsRemaining": null, + "stockDosesRemaining": null, + "runwayDays": null, + "ingredients": [], + "related": [] }, "error": null }, diff --git a/tests/integration/routes/parity/__snapshots__/medications.18a-writer.json.snap b/tests/integration/routes/parity/__snapshots__/medications.18a-writer.json.snap index ca74c6b43..524d5101f 100644 --- a/tests/integration/routes/parity/__snapshots__/medications.18a-writer.json.snap +++ b/tests/integration/routes/parity/__snapshots__/medications.18a-writer.json.snap @@ -62,7 +62,17 @@ "courses": [], "courseCount": 0, "previousCourseEndedOn": null, - "canStartCourse": false + "canStartCourse": false, + "nextDueAt": "2026-10-16T06:00:00.000Z", + "remindersActive": true, + "nextDueOverdue": false, + "courseStatus": "CURRENT", + "intakeActionable": true, + "stockUnitsRemaining": null, + "stockDosesRemaining": null, + "runwayDays": null, + "ingredients": [], + "related": [] }, "error": null }, diff --git a/tests/integration/routes/parity/medication-detail.parity.test.ts b/tests/integration/routes/parity/medication-detail.parity.test.ts index 64b13ac07..8ca3932e7 100644 --- a/tests/integration/routes/parity/medication-detail.parity.test.ts +++ b/tests/integration/routes/parity/medication-detail.parity.test.ts @@ -73,15 +73,6 @@ vi.mock( const prisma = getPrismaClient(); const NOW = new Date("2026-10-15T12:00:00.000Z"); const ROUTE = "/api/medications/{id}"; -/** - * The edit answers without the read-model fields (reminder state, stock and - * runway, composition, links) the registered medication resource declares. - * The parity snapshot pins that answer as it is; the contract check is the - * route's own tests' business. - */ -const EDIT_ANSWER = { - skip: "the edit answers without the read-model fields of the resource", -}; const CUSTOM_KEY = "custom:5b1f7c2e-4d3a-4b8e-9c61-2a7d0e9f4c13"; let ownerId: string; @@ -127,7 +118,6 @@ async function put( body, auth: caller.auth ?? owner, headers: caller.headers, - contract: EDIT_ANSWER, }, userIds, now: NOW, diff --git a/tests/integration/routes/parity/medication-intake-event.parity.test.ts b/tests/integration/routes/parity/medication-intake-event.parity.test.ts index 415422a60..acfbe8d4b 100644 --- a/tests/integration/routes/parity/medication-intake-event.parity.test.ts +++ b/tests/integration/routes/parity/medication-intake-event.parity.test.ts @@ -59,15 +59,6 @@ vi.mock( const prisma = getPrismaClient(); const NOW = new Date("2026-10-15T12:00:00.000Z"); const ROUTE = "/api/medications/{id}/intake/{eventId}"; -/** - * A correction that moves the dose answers with the row the shared slot write - * returns, which carries fewer fields than the registered event resource. The - * parity snapshot pins that answer as it is; the contract check is the - * route's own tests' business. - */ -const SLOT_MOVE_ANSWER = { - skip: "a slot move answers with the narrower slot-write row", -}; let ownerId: string; let userIds: string[]; @@ -86,7 +77,6 @@ async function put( auth?: RouteAuth; headers?: Record; medicationId?: string; - contract?: { skip: string }; } = {}, ) { return parityStep({ @@ -99,7 +89,6 @@ async function put( body, auth: options.auth ?? owner, headers: options.headers, - contract: options.contract, }, userIds, now: NOW, @@ -252,22 +241,16 @@ describe("PUT /api/medications/{id}/intake/{eventId} parity", () => { }); it("03 a take corrected into the other window, onto a skipped slot", async () => { - const res = await put( - "03-move-by-band", - events.morningTaken, - { takenAt: "2026-10-14T20:30:00.000Z" }, - { contract: SLOT_MOVE_ANSWER }, - ); + const res = await put("03-move-by-band", events.morningTaken, { + takenAt: "2026-10-14T20:30:00.000Z", + }); events.moved = (res.data as { id: string }).id; }); it("04 a legacy take pinned onto a free slot", async () => { - const res = await put( - "04-pin-free-slot", - events.legacyTaken, - { forceSlotInstant: "2026-10-12T20:00:00.000Z" }, - { contract: SLOT_MOVE_ANSWER }, - ); + const res = await put("04-pin-free-slot", events.legacyTaken, { + forceSlotInstant: "2026-10-12T20:00:00.000Z", + }); events.pinned = (res.data as { id: string }).id; }); @@ -284,25 +267,17 @@ describe("PUT /api/medications/{id}/intake/{eventId} parity", () => { }); it("07 an unpin", async () => { - const res = await put( - "07-unpin", - events.pinned, - { forceSlotInstant: null }, - { contract: SLOT_MOVE_ANSWER }, - ); + const res = await put("07-unpin", events.pinned, { + forceSlotInstant: null, + }); events.pinned = (res.data as { id: string }).id; }); it("08 an explicit slot in the body", async () => { - const res = await put( - "08-explicit-slot", - events.moved, - { - scheduledFor: "2026-10-14T08:00:00.000Z", - takenAt: "2026-10-14T08:45:00.000Z", - }, - { contract: SLOT_MOVE_ANSWER }, - ); + const res = await put("08-explicit-slot", events.moved, { + scheduledFor: "2026-10-14T08:00:00.000Z", + takenAt: "2026-10-14T08:45:00.000Z", + }); events.moved = (res.data as { id: string }).id; }); diff --git a/tests/integration/routes/parity/medication-intake-status.parity.test.ts b/tests/integration/routes/parity/medication-intake-status.parity.test.ts index b83135251..92f6c25bb 100644 --- a/tests/integration/routes/parity/medication-intake-status.parity.test.ts +++ b/tests/integration/routes/parity/medication-intake-status.parity.test.ts @@ -132,21 +132,7 @@ async function get( }); } -/** - * A take that re-binds to another slot answers with the row the shared slot - * write returns, which carries fewer fields than the registered event - * resource. The parity snapshot pins that answer as it is; the contract check - * is the route's own tests' business. - */ -const SLOT_MOVE_ANSWER = { - skip: "a slot move answers with the narrower slot-write row", -}; - -async function post( - name: string, - body: unknown, - caller: Caller & { contract?: { skip: string } } = {}, -) { +async function post(name: string, body: unknown, caller: Caller = {}) { await parityStep({ name: `medication-intake-status.${name}`, handler: POST, @@ -156,7 +142,6 @@ async function post( body, auth: caller.auth ?? owner, headers: caller.headers, - contract: caller.contract, }, userIds, now: NOW, @@ -362,28 +347,20 @@ describe("POST /api/medications/intake parity", () => { }); it("12 a take that re-binds to another slot", async () => { - await post( - "12-take-slot-move", - { - intakeId: ev.moveMe, - status: "taken", - takenAt: "2026-10-14T20:30:00.000Z", - }, - { contract: SLOT_MOVE_ANSWER }, - ); + await post("12-take-slot-move", { + intakeId: ev.moveMe, + status: "taken", + takenAt: "2026-10-14T20:30:00.000Z", + }); }); it("13 a pinned take, and a pin that is no slot", async () => { - await post( - "13a-pin", - { - intakeId: ev.pinMe, - status: "taken", - takenAt: "2026-10-13T11:00:00.000Z", - forceSlotInstant: "2026-10-13T08:00:00.000Z", - }, - { contract: SLOT_MOVE_ANSWER }, - ); + await post("13a-pin", { + intakeId: ev.pinMe, + status: "taken", + takenAt: "2026-10-13T11:00:00.000Z", + forceSlotInstant: "2026-10-13T08:00:00.000Z", + }); await post("13b-pin-not-a-slot", { intakeId: ev.snoozeMe, status: "taken", @@ -451,7 +428,7 @@ describe("POST /api/medications/intake parity", () => { await post( "20a-writer-take", { intakeId: ev.todayEvening, status: "taken" }, - { ...writer, contract: SLOT_MOVE_ANSWER }, + { ...writer }, ); await post( "20b-writer-snooze-refused", diff --git a/tests/integration/routes/parity/medication-intake.parity.test.ts b/tests/integration/routes/parity/medication-intake.parity.test.ts index 5d66bd899..e87cf639b 100644 --- a/tests/integration/routes/parity/medication-intake.parity.test.ts +++ b/tests/integration/routes/parity/medication-intake.parity.test.ts @@ -108,15 +108,6 @@ vi.mock("@/lib/notifications/delegated-intake", async (importOriginal) => { const prisma = getPrismaClient(); const NOW = new Date("2026-10-15T12:00:00.000Z"); const ROUTE = "/api/medications/{id}/intake"; -/** - * A dose that converges onto a slot answers with the row the shared slot - * write returns, which carries fewer fields than the registered event - * resource. The parity snapshot pins that answer as it is; the contract check - * is the route's own tests' business. - */ -const DOSE_ANSWER = { - skip: "a slot write answers with the narrower slot-write row", -}; const REFUSED = "medications.intake.update.refused"; let ownerId: string; @@ -159,7 +150,6 @@ async function post( body, auth: options.auth ?? owner, headers: options.headers, - contract: DOSE_ANSWER, }, userIds, now: NOW, diff --git a/tests/integration/routes/parity/medications.parity.test.ts b/tests/integration/routes/parity/medications.parity.test.ts index 028bfffa6..0e3b15478 100644 --- a/tests/integration/routes/parity/medications.parity.test.ts +++ b/tests/integration/routes/parity/medications.parity.test.ts @@ -42,15 +42,6 @@ vi.mock("@/lib/logging/transports", async (importOriginal) => { const prisma = getPrismaClient(); const NOW = new Date("2026-10-15T12:00:00.000Z"); const ROUTE = "/api/medications"; -/** - * The create answers without the read-model fields (reminder state, course - * status, stock and runway) the registered medication resource declares. The - * parity snapshot pins that answer as it is; the contract check is the - * route's own tests' business. - */ -const CREATE_ANSWER = { - skip: "the create answers without the read-model fields of the resource", -}; const CUSTOM_KEY = "custom:5b1f7c2e-4d3a-4b8e-9c61-2a7d0e9f4c13"; let ownerId: string; @@ -95,7 +86,6 @@ async function create( body, auth: options.auth ?? owner, headers: options.headers, - contract: CREATE_ANSWER, }, userIds: options.userIds ?? userIds, now: NOW,