fix(medications): answer writes with the shapes the contract declares

The create, its mirror replay and the edit answered the written row
without the read-model fields the declared resource carries (reminder
state, stock and runway, actionability, course status, composition,
links), while the detail read answered them. They answer the read model
now, built from the row they just wrote (medicationDetail), so a client
reads back exactly what GET /api/medications/{id} would say.

A dose write that converged onto an existing slot answered the slot
upsert's narrow row, without userId, medicationId, updatedAt,
autoRecorded, autoMissed or attributionSource. The upsert reads and
returns the whole event row, the same shape a write that inserted its own
answers. The parity walks drop their contract skips and are re-pinned.
This commit is contained in:
Marc-André Bombeck committed 2026-10-23 17:10:02 +02:00
1 parent 521b85bfbd
commit 51cba52751
63 files changed
+1839 -1323

No files matched your search

@@ -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<typeof import("@/lib/medications/read-medication")>();
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<typeof actual.medicationDetail>[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),
@@ -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<typeof import("@/lib/medications/read-medication")>();
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<typeof actual.medicationDetail>[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();
});
+36 -95
View File
@@ -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<typeof createMedicationSchema>;
type ScheduleInput = NonNullable<CreateMedicationInput["schedules"]>[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<string, unknown> & {
id: string;
unitsPerDose: unknown;
trackIntake: boolean;
schedules: Array<{ unitsPerDose: Prisma.Decimal | null }>;
},
user: ReadUser,
medication: Medication & { schedules: MedicationSchedule[] },
): Promise<CreateMedicationOutcome> {
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<CreateMedicationInput["externalSource"]>,
externalId: string,
): Promise<CreateMedicationOutcome | null> {
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<SessionUser, "id" | "timezone">;
user: ReadUser;
data: CreateMedicationInput;
ipAddress: string | null;
}): Promise<CreateMedicationOutcome> {
@@ -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 };
}
+30 -8
View File
@@ -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<SessionUser, "id" | "timezone" | "locale">;
export type ReadUser = Pick<SessionUser, "id" | "timezone" | "locale">;
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<Record<string, unknown>> {
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);
@@ -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> = {}): 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,
};
}
+10 -24
View File
@@ -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<PrismaClient, "medication" | "medicationIntakeEvent">;
/** 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 {
@@ -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<SessionUser, "id" | "timezone">;
type EditUser = ReadUser;
type EditedMedication = Awaited<ReturnType<typeof writeMedicationEdit>>;
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 };
}
@@ -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
},
@@ -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
},
@@ -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
},
@@ -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
},
@@ -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
},
@@ -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
},
@@ -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
},
@@ -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
},
@@ -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
},
@@ -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
},
@@ -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
},
@@ -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
},
@@ -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
},
@@ -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
},
@@ -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
},
@@ -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
},
@@ -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
},
@@ -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
},
@@ -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
},
@@ -3,12 +3,24 @@
"body": {
"data": {
"id": "<id:1>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"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": "<createdAt>"
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
"error": null
},
@@ -18,7 +30,7 @@
"action": {
"name": "medication.intake.update",
"entity_type": "intake_event",
"entity_id": "<id:2>"
"entity_id": "<id:4>"
},
"meta": {
"medication_id": "<id:3>"
@@ -32,7 +44,7 @@
"effect": "queueMedicationIntakeSync",
"args": [
{
"userId": "<id:4>",
"userId": "<id:2>",
"originDeviceToken": null
}
]
@@ -42,7 +54,7 @@
"medications": [
{
"id": "<id:5>",
"userId": "<id:4>",
"userId": "<id:2>",
"name": "Parity one-shot",
"dose": "10mg",
"treatmentClass": "GENERIC",
@@ -76,7 +88,7 @@
},
{
"id": "<id:3>",
"userId": "<id:4>",
"userId": "<id:2>",
"name": "Parity tablet",
"dose": "10mg",
"treatmentClass": "GENERIC",
@@ -171,7 +183,7 @@
"intakes": [
{
"id": "<id:9>",
"userId": "<id:4>",
"userId": "<id:2>",
"medicationId": "<id:5>",
"scheduledFor": "2026-10-10T09:00:00.000Z",
"takenAt": "2026-10-10T09:30:00.000Z",
@@ -192,7 +204,7 @@
},
{
"id": "<id:10>",
"userId": "<id:4>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-11T08:00:00.000Z",
"takenAt": "2026-10-11T08:20:00.000Z",
@@ -213,7 +225,7 @@
},
{
"id": "<id:11>",
"userId": "<id:4>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-11T20:00:00.000Z",
"takenAt": "2026-10-11T20:20:00.000Z",
@@ -234,7 +246,7 @@
},
{
"id": "<id:12>",
"userId": "<id:4>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-12T08:00:00.000Z",
"takenAt": "2026-10-12T08:05:00.000Z",
@@ -255,7 +267,7 @@
},
{
"id": "<id:13>",
"userId": "<id:4>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-13T08:00:00.000Z",
"takenAt": "2026-10-13T08:40:00.000Z",
@@ -276,7 +288,7 @@
},
{
"id": "<id:14>",
"userId": "<id:4>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-13T20:00:00.000Z",
"takenAt": "2026-10-13T20:15:00.000Z",
@@ -296,8 +308,8 @@
"deletedAt": null
},
{
"id": "<id:2>",
"userId": "<id:4>",
"id": "<id:4>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-14T08:00:00.000Z",
"takenAt": "2026-10-14T08:10:00.000Z",
@@ -318,7 +330,7 @@
},
{
"id": "<id:1>",
"userId": "<id:4>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-14T20:00:00.000Z",
"takenAt": "2026-10-14T20:30:00.000Z",
@@ -342,7 +354,7 @@
"inventoryItems": [
{
"id": "<id:15>",
"userId": "<id:4>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"state": "IN_USE",
"containerType": "OTHER",
@@ -366,10 +378,10 @@
"audit": [
{
"action": "medication.intake.update",
"userId": "<id:4>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"eventId": "<id:2>",
"eventId": "<id:4>",
"medicationId": "<id:3>",
"fields": [
"scheduledFor",
@@ -384,7 +396,7 @@
},
{
"action": "medication.intake.update",
"userId": "<id:4>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"eventId": "<id:13>",
@@ -400,7 +412,7 @@
},
{
"action": "medication.intake.update",
"userId": "<id:4>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"eventId": "<id:13>",
@@ -3,12 +3,24 @@
"body": {
"data": {
"id": "<id:1>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"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": "<createdAt>"
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
"error": null
},
@@ -18,7 +30,7 @@
"action": {
"name": "medication.intake.update",
"entity_type": "intake_event",
"entity_id": "<id:2>"
"entity_id": "<id:4>"
},
"meta": {
"medication_id": "<id:3>"
@@ -32,7 +44,7 @@
"effect": "queueMedicationIntakeSync",
"args": [
{
"userId": "<id:4>",
"userId": "<id:2>",
"originDeviceToken": null
}
]
@@ -42,7 +54,7 @@
"medications": [
{
"id": "<id:5>",
"userId": "<id:4>",
"userId": "<id:2>",
"name": "Parity one-shot",
"dose": "10mg",
"treatmentClass": "GENERIC",
@@ -76,7 +88,7 @@
},
{
"id": "<id:3>",
"userId": "<id:4>",
"userId": "<id:2>",
"name": "Parity tablet",
"dose": "10mg",
"treatmentClass": "GENERIC",
@@ -171,7 +183,7 @@
"intakes": [
{
"id": "<id:9>",
"userId": "<id:4>",
"userId": "<id:2>",
"medicationId": "<id:5>",
"scheduledFor": "2026-10-10T09:00:00.000Z",
"takenAt": "2026-10-10T09:30:00.000Z",
@@ -192,7 +204,7 @@
},
{
"id": "<id:10>",
"userId": "<id:4>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-11T08:00:00.000Z",
"takenAt": "2026-10-11T08:20:00.000Z",
@@ -213,7 +225,7 @@
},
{
"id": "<id:11>",
"userId": "<id:4>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-11T20:00:00.000Z",
"takenAt": "2026-10-11T20:20:00.000Z",
@@ -234,7 +246,7 @@
},
{
"id": "<id:12>",
"userId": "<id:4>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-12T08:00:00.000Z",
"takenAt": "2026-10-12T08:05:00.000Z",
@@ -255,7 +267,7 @@
},
{
"id": "<id:1>",
"userId": "<id:4>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-12T20:00:00.000Z",
"takenAt": "2026-10-13T20:15:00.000Z",
@@ -276,7 +288,7 @@
},
{
"id": "<id:13>",
"userId": "<id:4>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-13T08:00:00.000Z",
"takenAt": "2026-10-13T08:40:00.000Z",
@@ -296,8 +308,8 @@
"deletedAt": null
},
{
"id": "<id:2>",
"userId": "<id:4>",
"id": "<id:4>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-13T20:00:00.000Z",
"takenAt": "2026-10-13T20:15:00.000Z",
@@ -318,7 +330,7 @@
},
{
"id": "<id:14>",
"userId": "<id:4>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-14T08:00:00.000Z",
"takenAt": "2026-10-14T08:10:00.000Z",
@@ -339,7 +351,7 @@
},
{
"id": "<id:15>",
"userId": "<id:4>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-14T20:00:00.000Z",
"takenAt": "2026-10-14T20:30:00.000Z",
@@ -363,7 +375,7 @@
"inventoryItems": [
{
"id": "<id:16>",
"userId": "<id:4>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"state": "IN_USE",
"containerType": "OTHER",
@@ -387,7 +399,7 @@
"audit": [
{
"action": "medication.intake.update",
"userId": "<id:4>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"eventId": "<id:14>",
@@ -405,10 +417,10 @@
},
{
"action": "medication.intake.update",
"userId": "<id:4>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"eventId": "<id:2>",
"eventId": "<id:4>",
"medicationId": "<id:3>",
"fields": [
"scheduledFor"
@@ -421,7 +433,7 @@
},
{
"action": "medication.intake.update",
"userId": "<id:4>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"eventId": "<id:13>",
@@ -437,7 +449,7 @@
},
{
"action": "medication.intake.update",
"userId": "<id:4>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"eventId": "<id:13>",
@@ -3,12 +3,24 @@
"body": {
"data": {
"id": "<id:1>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"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": "<createdAt>"
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
"error": null
},
@@ -18,7 +30,7 @@
"action": {
"name": "medication.intake.update",
"entity_type": "intake_event",
"entity_id": "<id:2>"
"entity_id": "<id:4>"
},
"meta": {
"medication_id": "<id:3>"
@@ -32,7 +44,7 @@
"effect": "queueMedicationIntakeSync",
"args": [
{
"userId": "<id:4>",
"userId": "<id:2>",
"originDeviceToken": null
}
]
@@ -42,7 +54,7 @@
"medications": [
{
"id": "<id:5>",
"userId": "<id:4>",
"userId": "<id:2>",
"name": "Parity one-shot",
"dose": "10mg",
"treatmentClass": "GENERIC",
@@ -76,7 +88,7 @@
},
{
"id": "<id:3>",
"userId": "<id:4>",
"userId": "<id:2>",
"name": "Parity tablet",
"dose": "10mg",
"treatmentClass": "GENERIC",
@@ -171,7 +183,7 @@
"intakes": [
{
"id": "<id:9>",
"userId": "<id:4>",
"userId": "<id:2>",
"medicationId": "<id:5>",
"scheduledFor": "2026-10-10T09:00:00.000Z",
"takenAt": "2026-10-10T09:30:00.000Z",
@@ -192,7 +204,7 @@
},
{
"id": "<id:10>",
"userId": "<id:4>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-11T08:00:00.000Z",
"takenAt": "2026-10-11T08:20:00.000Z",
@@ -213,7 +225,7 @@
},
{
"id": "<id:11>",
"userId": "<id:4>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-11T20:00:00.000Z",
"takenAt": "2026-10-11T20:20:00.000Z",
@@ -234,7 +246,7 @@
},
{
"id": "<id:12>",
"userId": "<id:4>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"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": "<id:2>",
"userId": "<id:4>",
"id": "<id:4>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-12T20:00:00.000Z",
"takenAt": "2026-10-13T20:15:00.000Z",
@@ -276,7 +288,7 @@
},
{
"id": "<id:13>",
"userId": "<id:4>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-13T08:00:00.000Z",
"takenAt": "2026-10-13T08:40:00.000Z",
@@ -297,7 +309,7 @@
},
{
"id": "<id:14>",
"userId": "<id:4>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-13T20:00:00.000Z",
"takenAt": "2026-10-13T20:15:00.000Z",
@@ -318,7 +330,7 @@
},
{
"id": "<id:1>",
"userId": "<id:4>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-13T20:00:00.000Z",
"takenAt": "2026-10-13T20:15:00.000Z",
@@ -339,7 +351,7 @@
},
{
"id": "<id:15>",
"userId": "<id:4>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-14T08:00:00.000Z",
"takenAt": "2026-10-14T08:10:00.000Z",
@@ -360,7 +372,7 @@
},
{
"id": "<id:16>",
"userId": "<id:4>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-14T20:00:00.000Z",
"takenAt": "2026-10-14T20:30:00.000Z",
@@ -384,7 +396,7 @@
"inventoryItems": [
{
"id": "<id:17>",
"userId": "<id:4>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"state": "IN_USE",
"containerType": "OTHER",
@@ -408,7 +420,7 @@
"audit": [
{
"action": "medication.intake.update",
"userId": "<id:4>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"eventId": "<id:15>",
@@ -426,10 +438,10 @@
},
{
"action": "medication.intake.update",
"userId": "<id:4>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"eventId": "<id:2>",
"eventId": "<id:4>",
"medicationId": "<id:3>",
"fields": [
"scheduledFor"
@@ -442,7 +454,7 @@
},
{
"action": "medication.intake.update",
"userId": "<id:4>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"eventId": "<id:14>",
@@ -458,7 +470,7 @@
},
{
"action": "medication.intake.update",
"userId": "<id:4>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"eventId": "<id:13>",
@@ -474,7 +486,7 @@
},
{
"action": "medication.intake.update",
"userId": "<id:4>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"eventId": "<id:13>",
@@ -3,12 +3,24 @@
"body": {
"data": {
"id": "<id:1>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"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": "<createdAt>"
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
"error": null
},
@@ -18,7 +30,7 @@
"action": {
"name": "medication.intake.update",
"entity_type": "intake_event",
"entity_id": "<id:2>"
"entity_id": "<id:4>"
},
"meta": {
"medication_id": "<id:3>"
@@ -32,7 +44,7 @@
"effect": "queueMedicationIntakeSync",
"args": [
{
"userId": "<id:4>",
"userId": "<id:2>",
"originDeviceToken": null
}
]
@@ -42,7 +54,7 @@
"medications": [
{
"id": "<id:5>",
"userId": "<id:4>",
"userId": "<id:2>",
"name": "Parity one-shot",
"dose": "10mg",
"treatmentClass": "GENERIC",
@@ -76,7 +88,7 @@
},
{
"id": "<id:3>",
"userId": "<id:4>",
"userId": "<id:2>",
"name": "Parity tablet",
"dose": "10mg",
"treatmentClass": "GENERIC",
@@ -171,7 +183,7 @@
"intakes": [
{
"id": "<id:9>",
"userId": "<id:4>",
"userId": "<id:2>",
"medicationId": "<id:5>",
"scheduledFor": "2026-10-10T09:00:00.000Z",
"takenAt": "2026-10-10T09:30:00.000Z",
@@ -192,7 +204,7 @@
},
{
"id": "<id:10>",
"userId": "<id:4>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-11T08:00:00.000Z",
"takenAt": "2026-10-11T08:20:00.000Z",
@@ -213,7 +225,7 @@
},
{
"id": "<id:11>",
"userId": "<id:4>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-11T20:00:00.000Z",
"takenAt": "2026-10-11T20:20:00.000Z",
@@ -234,7 +246,7 @@
},
{
"id": "<id:12>",
"userId": "<id:4>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-12T08:00:00.000Z",
"takenAt": "2026-10-12T08:05:00.000Z",
@@ -255,7 +267,7 @@
},
{
"id": "<id:13>",
"userId": "<id:4>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-12T20:00:00.000Z",
"takenAt": "2026-10-13T20:15:00.000Z",
@@ -276,7 +288,7 @@
},
{
"id": "<id:14>",
"userId": "<id:4>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-13T08:00:00.000Z",
"takenAt": "2026-10-13T08:40:00.000Z",
@@ -297,7 +309,7 @@
},
{
"id": "<id:15>",
"userId": "<id:4>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-13T20:00:00.000Z",
"takenAt": "2026-10-13T20:15:00.000Z",
@@ -318,7 +330,7 @@
},
{
"id": "<id:16>",
"userId": "<id:4>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-13T20:00:00.000Z",
"takenAt": "2026-10-13T20:15:00.000Z",
@@ -339,7 +351,7 @@
},
{
"id": "<id:17>",
"userId": "<id:4>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-14T08:00:00.000Z",
"takenAt": "2026-10-14T08:10:00.000Z",
@@ -360,7 +372,7 @@
},
{
"id": "<id:1>",
"userId": "<id:4>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-14T08:00:00.000Z",
"takenAt": "2026-10-14T08:45:00.000Z",
@@ -380,8 +392,8 @@
"deletedAt": null
},
{
"id": "<id:2>",
"userId": "<id:4>",
"id": "<id:4>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-14T20:00:00.000Z",
"takenAt": "2026-10-14T20:30:00.000Z",
@@ -405,7 +417,7 @@
"inventoryItems": [
{
"id": "<id:18>",
"userId": "<id:4>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"state": "IN_USE",
"containerType": "OTHER",
@@ -429,7 +441,7 @@
"audit": [
{
"action": "medication.intake.update",
"userId": "<id:4>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"eventId": "<id:17>",
@@ -447,10 +459,10 @@
},
{
"action": "medication.intake.update",
"userId": "<id:4>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"eventId": "<id:2>",
"eventId": "<id:4>",
"medicationId": "<id:3>",
"fields": [
"scheduledFor",
@@ -465,7 +477,7 @@
},
{
"action": "medication.intake.update",
"userId": "<id:4>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"eventId": "<id:13>",
@@ -481,7 +493,7 @@
},
{
"action": "medication.intake.update",
"userId": "<id:4>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"eventId": "<id:15>",
@@ -497,7 +509,7 @@
},
{
"action": "medication.intake.update",
"userId": "<id:4>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"eventId": "<id:14>",
@@ -513,7 +525,7 @@
},
{
"action": "medication.intake.update",
"userId": "<id:4>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"eventId": "<id:14>",
@@ -3,12 +3,24 @@
"body": {
"data": {
"id": "<id:1>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"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": "<createdAt>"
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": "ABDOMEN_LEFT",
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
"error": null
},
@@ -19,13 +31,13 @@
"name": "medications.intake.update"
},
"meta": {
"medication_id": "<id:2>",
"medication_id": "<id:3>",
"units": 1,
"item_ids": [
"<id:3>"
"<id:4>"
],
"auto_opened": 0,
"intakeId": "<id:4>",
"intakeId": "<id:5>",
"status": "taken"
},
"warnings": null,
@@ -37,7 +49,7 @@
"effect": "queueMedicationIntakeSync",
"args": [
{
"userId": "<id:5>",
"userId": "<id:2>",
"originDeviceToken": null
}
]
@@ -45,7 +57,7 @@
{
"effect": "countOutstandingDosesToday",
"args": [
"<id:5>",
"<id:2>",
"UTC"
]
},
@@ -53,9 +65,9 @@
"effect": "notifyDelegatedIntake",
"args": [
{
"ownerId": "<id:5>",
"actorId": "<id:5>",
"medicationId": "<id:2>",
"ownerId": "<id:2>",
"actorId": "<id:2>",
"medicationId": "<id:3>",
"status": "taken"
}
]
@@ -64,8 +76,8 @@
"effect": "dispatchMedicationIntakeWebClear",
"args": [
{
"userId": "<id:5>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-14T20:00:00.000Z",
"badgeCount": 2
}
@@ -76,7 +88,7 @@
"medications": [
{
"id": "<id:6>",
"userId": "<id:5>",
"userId": "<id:2>",
"name": "Daily pen",
"dose": "10mg",
"treatmentClass": "GENERIC",
@@ -113,7 +125,7 @@
},
{
"id": "<id:7>",
"userId": "<id:5>",
"userId": "<id:2>",
"name": "Record only",
"dose": "10mg",
"treatmentClass": "GENERIC",
@@ -147,7 +159,7 @@
},
{
"id": "<id:8>",
"userId": "<id:5>",
"userId": "<id:2>",
"name": "Three times",
"dose": "10mg",
"treatmentClass": "GENERIC",
@@ -180,8 +192,8 @@
"updatedAt": "<updatedAt>"
},
{
"id": "<id:2>",
"userId": "<id:5>",
"id": "<id:3>",
"userId": "<id:2>",
"name": "Twice daily",
"dose": "10mg",
"treatmentClass": "GENERIC",
@@ -259,7 +271,7 @@
},
{
"id": "<id:11>",
"medicationId": "<id:2>",
"medicationId": "<id:3>",
"windowStart": "08:00",
"windowEnd": "10:00",
"label": null,
@@ -339,7 +351,7 @@
},
{
"id": "<id:15>",
"medicationId": "<id:2>",
"medicationId": "<id:3>",
"windowStart": "20:00",
"windowEnd": "22:00",
"label": null,
@@ -364,8 +376,8 @@
"intakes": [
{
"id": "<id:16>",
"userId": "<id:5>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-09T08:00:00.000Z",
"takenAt": null,
"skipped": false,
@@ -385,8 +397,8 @@
},
{
"id": "<id:17>",
"userId": "<id:5>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-10T08:00:00.000Z",
"takenAt": "2026-10-10T08:05:00.000Z",
"skipped": false,
@@ -406,8 +418,8 @@
},
{
"id": "<id:18>",
"userId": "<id:5>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-11T08:00:00.000Z",
"takenAt": null,
"skipped": false,
@@ -427,8 +439,8 @@
},
{
"id": "<id:19>",
"userId": "<id:5>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-12T08:00:00.000Z",
"takenAt": "2026-10-12T08:10:00.000Z",
"skipped": false,
@@ -448,7 +460,7 @@
},
{
"id": "<id:20>",
"userId": "<id:5>",
"userId": "<id:2>",
"medicationId": "<id:7>",
"scheduledFor": "2026-10-13T07:00:00.000Z",
"takenAt": "2026-10-13T07:05:00.000Z",
@@ -469,8 +481,8 @@
},
{
"id": "<id:21>",
"userId": "<id:5>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-13T20:00:00.000Z",
"takenAt": null,
"skipped": false,
@@ -490,7 +502,7 @@
},
{
"id": "<id:22>",
"userId": "<id:5>",
"userId": "<id:2>",
"medicationId": "<id:7>",
"scheduledFor": "2026-10-14T07:00:00.000Z",
"takenAt": null,
@@ -510,9 +522,9 @@
"deletedAt": null
},
{
"id": "<id:4>",
"userId": "<id:5>",
"medicationId": "<id:2>",
"id": "<id:5>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-14T08:00:00.000Z",
"takenAt": null,
"skipped": false,
@@ -532,8 +544,8 @@
},
{
"id": "<id:1>",
"userId": "<id:5>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-14T20:00:00.000Z",
"takenAt": "2026-10-14T20:30:00.000Z",
"skipped": false,
@@ -548,7 +560,7 @@
"inventoryConsumption": [
{
"units": 1,
"itemId": "<id:3>"
"itemId": "<id:4>"
}
],
"externalId": null,
@@ -558,7 +570,7 @@
},
{
"id": "<id:23>",
"userId": "<id:5>",
"userId": "<id:2>",
"medicationId": "<id:8>",
"scheduledFor": "2026-10-15T06:00:00.000Z",
"takenAt": null,
@@ -579,8 +591,8 @@
},
{
"id": "<id:24>",
"userId": "<id:5>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-15T08:00:00.000Z",
"takenAt": "2026-10-15T08:30:00.000Z",
"skipped": false,
@@ -595,7 +607,7 @@
"inventoryConsumption": [
{
"units": 1,
"itemId": "<id:3>"
"itemId": "<id:4>"
}
],
"externalId": null,
@@ -605,7 +617,7 @@
},
{
"id": "<id:25>",
"userId": "<id:5>",
"userId": "<id:2>",
"medicationId": "<id:6>",
"scheduledFor": "2026-10-15T09:00:00.000Z",
"takenAt": null,
@@ -626,7 +638,7 @@
},
{
"id": "<id:26>",
"userId": "<id:5>",
"userId": "<id:2>",
"medicationId": "<id:8>",
"scheduledFor": "2026-10-15T10:00:00.000Z",
"takenAt": "2026-10-15T10:05:00.000Z",
@@ -647,7 +659,7 @@
},
{
"id": "<id:27>",
"userId": "<id:5>",
"userId": "<id:2>",
"medicationId": "<id:8>",
"scheduledFor": "2026-10-15T13:00:00.000Z",
"takenAt": null,
@@ -668,8 +680,8 @@
},
{
"id": "<id:28>",
"userId": "<id:5>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-15T20:00:00.000Z",
"takenAt": null,
"skipped": false,
@@ -691,9 +703,9 @@
"doseChanges": [],
"inventoryItems": [
{
"id": "<id:3>",
"userId": "<id:5>",
"medicationId": "<id:2>",
"id": "<id:4>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"state": "IN_USE",
"containerType": "OTHER",
"unitsTotal": "30",
@@ -716,7 +728,7 @@
"audit": [
{
"action": "medications.intake.update",
"userId": "<id:5>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"intakeId": "<id:24>",
@@ -726,10 +738,10 @@
},
{
"action": "medications.intake.update",
"userId": "<id:5>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"intakeId": "<id:4>",
"intakeId": "<id:5>",
"status": "taken"
},
"ipAddress": null
@@ -3,12 +3,24 @@
"body": {
"data": {
"id": "<id:1>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"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": "<createdAt>"
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
"error": null
},
@@ -19,13 +31,13 @@
"name": "medications.intake.update"
},
"meta": {
"medication_id": "<id:2>",
"medication_id": "<id:3>",
"units": 1,
"item_ids": [
"<id:3>"
"<id:4>"
],
"auto_opened": 0,
"intakeId": "<id:4>",
"intakeId": "<id:5>",
"status": "taken"
},
"warnings": null,
@@ -37,7 +49,7 @@
"effect": "queueMedicationIntakeSync",
"args": [
{
"userId": "<id:5>",
"userId": "<id:2>",
"originDeviceToken": null
}
]
@@ -45,7 +57,7 @@
{
"effect": "countOutstandingDosesToday",
"args": [
"<id:5>",
"<id:2>",
"UTC"
]
},
@@ -53,9 +65,9 @@
"effect": "notifyDelegatedIntake",
"args": [
{
"ownerId": "<id:5>",
"actorId": "<id:5>",
"medicationId": "<id:2>",
"ownerId": "<id:2>",
"actorId": "<id:2>",
"medicationId": "<id:3>",
"status": "taken"
}
]
@@ -64,8 +76,8 @@
"effect": "dispatchMedicationIntakeWebClear",
"args": [
{
"userId": "<id:5>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-13T08:00:00.000Z",
"badgeCount": 2
}
@@ -76,7 +88,7 @@
"medications": [
{
"id": "<id:6>",
"userId": "<id:5>",
"userId": "<id:2>",
"name": "Daily pen",
"dose": "10mg",
"treatmentClass": "GENERIC",
@@ -113,7 +125,7 @@
},
{
"id": "<id:7>",
"userId": "<id:5>",
"userId": "<id:2>",
"name": "Record only",
"dose": "10mg",
"treatmentClass": "GENERIC",
@@ -147,7 +159,7 @@
},
{
"id": "<id:8>",
"userId": "<id:5>",
"userId": "<id:2>",
"name": "Three times",
"dose": "10mg",
"treatmentClass": "GENERIC",
@@ -180,8 +192,8 @@
"updatedAt": "<updatedAt>"
},
{
"id": "<id:2>",
"userId": "<id:5>",
"id": "<id:3>",
"userId": "<id:2>",
"name": "Twice daily",
"dose": "10mg",
"treatmentClass": "GENERIC",
@@ -259,7 +271,7 @@
},
{
"id": "<id:11>",
"medicationId": "<id:2>",
"medicationId": "<id:3>",
"windowStart": "08:00",
"windowEnd": "10:00",
"label": null,
@@ -339,7 +351,7 @@
},
{
"id": "<id:15>",
"medicationId": "<id:2>",
"medicationId": "<id:3>",
"windowStart": "20:00",
"windowEnd": "22:00",
"label": null,
@@ -364,8 +376,8 @@
"intakes": [
{
"id": "<id:16>",
"userId": "<id:5>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-09T08:00:00.000Z",
"takenAt": null,
"skipped": false,
@@ -385,8 +397,8 @@
},
{
"id": "<id:17>",
"userId": "<id:5>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-10T08:00:00.000Z",
"takenAt": "2026-10-10T08:05:00.000Z",
"skipped": false,
@@ -406,8 +418,8 @@
},
{
"id": "<id:18>",
"userId": "<id:5>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-11T08:00:00.000Z",
"takenAt": null,
"skipped": false,
@@ -427,8 +439,8 @@
},
{
"id": "<id:19>",
"userId": "<id:5>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-12T08:00:00.000Z",
"takenAt": "2026-10-12T08:10:00.000Z",
"skipped": false,
@@ -448,7 +460,7 @@
},
{
"id": "<id:20>",
"userId": "<id:5>",
"userId": "<id:2>",
"medicationId": "<id:7>",
"scheduledFor": "2026-10-13T07:00:00.000Z",
"takenAt": "2026-10-13T07:05:00.000Z",
@@ -469,8 +481,8 @@
},
{
"id": "<id:1>",
"userId": "<id:5>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-13T08:00:00.000Z",
"takenAt": "2026-10-13T11:00:00.000Z",
"skipped": false,
@@ -485,7 +497,7 @@
"inventoryConsumption": [
{
"units": 1,
"itemId": "<id:3>"
"itemId": "<id:4>"
}
],
"externalId": null,
@@ -494,9 +506,9 @@
"deletedAt": null
},
{
"id": "<id:4>",
"userId": "<id:5>",
"medicationId": "<id:2>",
"id": "<id:5>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-13T20:00:00.000Z",
"takenAt": null,
"skipped": false,
@@ -516,7 +528,7 @@
},
{
"id": "<id:21>",
"userId": "<id:5>",
"userId": "<id:2>",
"medicationId": "<id:7>",
"scheduledFor": "2026-10-14T07:00:00.000Z",
"takenAt": null,
@@ -537,8 +549,8 @@
},
{
"id": "<id:22>",
"userId": "<id:5>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-14T08:00:00.000Z",
"takenAt": null,
"skipped": false,
@@ -558,8 +570,8 @@
},
{
"id": "<id:23>",
"userId": "<id:5>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-14T20:00:00.000Z",
"takenAt": "2026-10-14T20:30:00.000Z",
"skipped": false,
@@ -574,7 +586,7 @@
"inventoryConsumption": [
{
"units": 1,
"itemId": "<id:3>"
"itemId": "<id:4>"
}
],
"externalId": null,
@@ -584,7 +596,7 @@
},
{
"id": "<id:24>",
"userId": "<id:5>",
"userId": "<id:2>",
"medicationId": "<id:8>",
"scheduledFor": "2026-10-15T06:00:00.000Z",
"takenAt": null,
@@ -605,8 +617,8 @@
},
{
"id": "<id:25>",
"userId": "<id:5>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-15T08:00:00.000Z",
"takenAt": "2026-10-15T08:30:00.000Z",
"skipped": false,
@@ -621,7 +633,7 @@
"inventoryConsumption": [
{
"units": 1,
"itemId": "<id:3>"
"itemId": "<id:4>"
}
],
"externalId": null,
@@ -631,7 +643,7 @@
},
{
"id": "<id:26>",
"userId": "<id:5>",
"userId": "<id:2>",
"medicationId": "<id:6>",
"scheduledFor": "2026-10-15T09:00:00.000Z",
"takenAt": null,
@@ -652,7 +664,7 @@
},
{
"id": "<id:27>",
"userId": "<id:5>",
"userId": "<id:2>",
"medicationId": "<id:8>",
"scheduledFor": "2026-10-15T10:00:00.000Z",
"takenAt": "2026-10-15T10:05:00.000Z",
@@ -673,7 +685,7 @@
},
{
"id": "<id:28>",
"userId": "<id:5>",
"userId": "<id:2>",
"medicationId": "<id:8>",
"scheduledFor": "2026-10-15T13:00:00.000Z",
"takenAt": null,
@@ -694,8 +706,8 @@
},
{
"id": "<id:29>",
"userId": "<id:5>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-15T20:00:00.000Z",
"takenAt": null,
"skipped": false,
@@ -717,9 +729,9 @@
"doseChanges": [],
"inventoryItems": [
{
"id": "<id:3>",
"userId": "<id:5>",
"medicationId": "<id:2>",
"id": "<id:4>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"state": "IN_USE",
"containerType": "OTHER",
"unitsTotal": "30",
@@ -742,7 +754,7 @@
"audit": [
{
"action": "medications.intake.update",
"userId": "<id:5>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"intakeId": "<id:25>",
@@ -752,7 +764,7 @@
},
{
"action": "medications.intake.update",
"userId": "<id:5>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"intakeId": "<id:22>",
@@ -762,10 +774,10 @@
},
{
"action": "medications.intake.update",
"userId": "<id:5>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"intakeId": "<id:4>",
"intakeId": "<id:5>",
"status": "taken"
},
"ipAddress": null
@@ -3,12 +3,29 @@
"body": {
"data": {
"id": "<id:1>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-15T08:00:00.000Z",
"takenAt": "<now>",
"skipped": false,
"idempotencyKey": null,
"scheduledFor": "2026-10-15T08:00:00.000Z",
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "REMINDER",
"createdAt": "<createdAt>"
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": [
{
"units": 1,
"itemId": "<id:4>"
}
],
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
"error": null
},
@@ -19,7 +36,7 @@
"name": "medications.intake.update"
},
"meta": {
"intakeId": "<id:2>",
"intakeId": "<id:5>",
"status": "taken"
},
"warnings": null,
@@ -31,7 +48,7 @@
"effect": "queueMedicationIntakeSync",
"args": [
{
"userId": "<id:3>",
"userId": "<id:2>",
"originDeviceToken": null
}
]
@@ -39,7 +56,7 @@
{
"effect": "countOutstandingDosesToday",
"args": [
"<id:3>",
"<id:2>",
"UTC"
]
},
@@ -47,9 +64,9 @@
"effect": "notifyDelegatedIntake",
"args": [
{
"ownerId": "<id:3>",
"actorId": "<id:4>",
"medicationId": "<id:5>",
"ownerId": "<id:2>",
"actorId": "<id:6>",
"medicationId": "<id:3>",
"status": "taken"
}
]
@@ -58,8 +75,8 @@
"effect": "dispatchMedicationIntakeWebClear",
"args": [
{
"userId": "<id:3>",
"medicationId": "<id:5>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-15T08:00:00.000Z",
"badgeCount": 2
}
@@ -69,8 +86,8 @@
"stored": {
"medications": [
{
"id": "<id:6>",
"userId": "<id:3>",
"id": "<id:7>",
"userId": "<id:2>",
"name": "Daily pen",
"dose": "10mg",
"treatmentClass": "GENERIC",
@@ -106,8 +123,8 @@
"updatedAt": "<updatedAt>"
},
{
"id": "<id:7>",
"userId": "<id:3>",
"id": "<id:8>",
"userId": "<id:2>",
"name": "Record only",
"dose": "10mg",
"treatmentClass": "GENERIC",
@@ -140,8 +157,8 @@
"updatedAt": "<updatedAt>"
},
{
"id": "<id:8>",
"userId": "<id:3>",
"id": "<id:9>",
"userId": "<id:2>",
"name": "Three times",
"dose": "10mg",
"treatmentClass": "GENERIC",
@@ -174,8 +191,8 @@
"updatedAt": "<updatedAt>"
},
{
"id": "<id:5>",
"userId": "<id:3>",
"id": "<id:3>",
"userId": "<id:2>",
"name": "Twice daily",
"dose": "10mg",
"treatmentClass": "GENERIC",
@@ -212,8 +229,8 @@
],
"schedules": [
{
"id": "<id:9>",
"medicationId": "<id:8>",
"id": "<id:10>",
"medicationId": "<id:9>",
"windowStart": "06:00",
"windowEnd": "07:00",
"label": null,
@@ -232,8 +249,8 @@
"doseWindows": null
},
{
"id": "<id:10>",
"medicationId": "<id:7>",
"id": "<id:11>",
"medicationId": "<id:8>",
"windowStart": "07:00",
"windowEnd": "08:00",
"label": null,
@@ -252,8 +269,8 @@
"doseWindows": null
},
{
"id": "<id:11>",
"medicationId": "<id:5>",
"id": "<id:12>",
"medicationId": "<id:3>",
"windowStart": "08:00",
"windowEnd": "10:00",
"label": null,
@@ -272,8 +289,8 @@
"doseWindows": null
},
{
"id": "<id:12>",
"medicationId": "<id:6>",
"id": "<id:13>",
"medicationId": "<id:7>",
"windowStart": "09:00",
"windowEnd": "11:00",
"label": null,
@@ -292,8 +309,8 @@
"doseWindows": null
},
{
"id": "<id:13>",
"medicationId": "<id:8>",
"id": "<id:14>",
"medicationId": "<id:9>",
"windowStart": "10:00",
"windowEnd": "11:00",
"label": null,
@@ -312,8 +329,8 @@
"doseWindows": null
},
{
"id": "<id:14>",
"medicationId": "<id:8>",
"id": "<id:15>",
"medicationId": "<id:9>",
"windowStart": "13:00",
"windowEnd": "14:00",
"label": null,
@@ -332,8 +349,8 @@
"doseWindows": null
},
{
"id": "<id:15>",
"medicationId": "<id:5>",
"id": "<id:16>",
"medicationId": "<id:3>",
"windowStart": "20:00",
"windowEnd": "22:00",
"label": null,
@@ -357,9 +374,9 @@
"courses": [],
"intakes": [
{
"id": "<id:16>",
"userId": "<id:3>",
"medicationId": "<id:5>",
"id": "<id:17>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-09T08:00:00.000Z",
"takenAt": null,
"skipped": false,
@@ -378,9 +395,9 @@
"deletedAt": "2026-10-09T09:00:00.000Z"
},
{
"id": "<id:17>",
"userId": "<id:3>",
"medicationId": "<id:5>",
"id": "<id:18>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-10T08:00:00.000Z",
"takenAt": "2026-10-10T08:05:00.000Z",
"skipped": false,
@@ -399,9 +416,9 @@
"deletedAt": null
},
{
"id": "<id:18>",
"userId": "<id:3>",
"medicationId": "<id:5>",
"id": "<id:19>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-11T08:00:00.000Z",
"takenAt": null,
"skipped": false,
@@ -420,9 +437,9 @@
"deletedAt": null
},
{
"id": "<id:19>",
"userId": "<id:3>",
"medicationId": "<id:5>",
"id": "<id:20>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-12T08:00:00.000Z",
"takenAt": null,
"skipped": true,
@@ -441,9 +458,9 @@
"deletedAt": null
},
{
"id": "<id:20>",
"userId": "<id:3>",
"medicationId": "<id:7>",
"id": "<id:21>",
"userId": "<id:2>",
"medicationId": "<id:8>",
"scheduledFor": "2026-10-13T07:00:00.000Z",
"takenAt": "2026-10-13T07:20:00.000Z",
"skipped": false,
@@ -462,9 +479,9 @@
"deletedAt": null
},
{
"id": "<id:21>",
"userId": "<id:3>",
"medicationId": "<id:5>",
"id": "<id:22>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-13T08:00:00.000Z",
"takenAt": "2026-10-13T11:00:00.000Z",
"skipped": false,
@@ -479,7 +496,7 @@
"inventoryConsumption": [
{
"units": 1,
"itemId": "<id:22>"
"itemId": "<id:4>"
}
],
"externalId": null,
@@ -489,8 +506,8 @@
},
{
"id": "<id:23>",
"userId": "<id:3>",
"medicationId": "<id:5>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-13T20:00:00.000Z",
"takenAt": null,
"skipped": false,
@@ -510,8 +527,8 @@
},
{
"id": "<id:24>",
"userId": "<id:3>",
"medicationId": "<id:7>",
"userId": "<id:2>",
"medicationId": "<id:8>",
"scheduledFor": "2026-10-14T07:00:00.000Z",
"takenAt": null,
"skipped": false,
@@ -531,8 +548,8 @@
},
{
"id": "<id:25>",
"userId": "<id:3>",
"medicationId": "<id:5>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-14T08:00:00.000Z",
"takenAt": null,
"skipped": false,
@@ -552,8 +569,8 @@
},
{
"id": "<id:26>",
"userId": "<id:3>",
"medicationId": "<id:5>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-14T20:00:00.000Z",
"takenAt": "2026-10-14T20:30:00.000Z",
"skipped": false,
@@ -568,7 +585,7 @@
"inventoryConsumption": [
{
"units": 1,
"itemId": "<id:22>"
"itemId": "<id:4>"
}
],
"externalId": null,
@@ -578,8 +595,8 @@
},
{
"id": "<id:27>",
"userId": "<id:3>",
"medicationId": "<id:8>",
"userId": "<id:2>",
"medicationId": "<id:9>",
"scheduledFor": "2026-10-15T06:00:00.000Z",
"takenAt": null,
"skipped": false,
@@ -599,8 +616,8 @@
},
{
"id": "<id:1>",
"userId": "<id:3>",
"medicationId": "<id:5>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-15T08:00:00.000Z",
"takenAt": "<now>",
"skipped": false,
@@ -615,7 +632,7 @@
"inventoryConsumption": [
{
"units": 1,
"itemId": "<id:22>"
"itemId": "<id:4>"
}
],
"externalId": null,
@@ -625,8 +642,8 @@
},
{
"id": "<id:28>",
"userId": "<id:3>",
"medicationId": "<id:6>",
"userId": "<id:2>",
"medicationId": "<id:7>",
"scheduledFor": "2026-10-15T09:00:00.000Z",
"takenAt": "2026-10-15T09:15:00.000Z",
"skipped": false,
@@ -646,8 +663,8 @@
},
{
"id": "<id:29>",
"userId": "<id:3>",
"medicationId": "<id:8>",
"userId": "<id:2>",
"medicationId": "<id:9>",
"scheduledFor": "2026-10-15T10:00:00.000Z",
"takenAt": "2026-10-15T10:05:00.000Z",
"skipped": false,
@@ -667,8 +684,8 @@
},
{
"id": "<id:30>",
"userId": "<id:3>",
"medicationId": "<id:8>",
"userId": "<id:2>",
"medicationId": "<id:9>",
"scheduledFor": "2026-10-15T13:00:00.000Z",
"takenAt": null,
"skipped": true,
@@ -687,9 +704,9 @@
"deletedAt": null
},
{
"id": "<id:2>",
"userId": "<id:3>",
"medicationId": "<id:5>",
"id": "<id:5>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-15T20:00:00.000Z",
"takenAt": null,
"skipped": false,
@@ -711,9 +728,9 @@
"doseChanges": [],
"inventoryItems": [
{
"id": "<id:22>",
"userId": "<id:3>",
"medicationId": "<id:5>",
"id": "<id:4>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"state": "IN_USE",
"containerType": "OTHER",
"unitsTotal": "30",
@@ -736,47 +753,47 @@
"audit": [
{
"action": "medications.intake.update",
"userId": "<id:3>",
"actorUserId": "<id:4>",
"userId": "<id:2>",
"actorUserId": "<id:6>",
"details": {
"intakeId": "<id:2>",
"intakeId": "<id:5>",
"status": "taken"
},
"ipAddress": null
},
{
"action": "medications.intake.update",
"userId": "<id:3>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"intakeId": "<id:19>",
"intakeId": "<id:20>",
"status": "skipped"
},
"ipAddress": null
},
{
"action": "medications.intake.update",
"userId": "<id:3>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"intakeId": "<id:18>",
"intakeId": "<id:19>",
"status": "snoozed"
},
"ipAddress": null
},
{
"action": "medications.intake.update",
"userId": "<id:3>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"intakeId": "<id:18>",
"intakeId": "<id:19>",
"status": "snoozed"
},
"ipAddress": null
},
{
"action": "medications.intake.update",
"userId": "<id:3>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"intakeId": "<id:1>",
@@ -786,7 +803,7 @@
},
{
"action": "medications.intake.update",
"userId": "<id:3>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"intakeId": "<id:25>",
@@ -796,7 +813,7 @@
},
{
"action": "medications.intake.update",
"userId": "<id:3>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"intakeId": "<id:23>",
@@ -806,17 +823,17 @@
},
{
"action": "medications.intake.update",
"userId": "<id:3>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"intakeId": "<id:20>",
"intakeId": "<id:21>",
"status": "taken"
},
"ipAddress": null
},
{
"action": "medications.intake.update",
"userId": "<id:3>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"intakeId": "<id:28>",
@@ -3,12 +3,24 @@
"body": {
"data": {
"id": "<id:1>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"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": "<createdAt>"
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
"error": null
},
@@ -21,10 +33,10 @@
"entity_id": "<id:1>"
},
"meta": {
"medication_id": "<id:2>",
"medication_id": "<id:3>",
"units": 1,
"item_ids": [
"<id:3>"
"<id:4>"
],
"auto_opened": 1,
"skipped": false
@@ -38,7 +50,7 @@
"effect": "queueMedicationIntakeSync",
"args": [
{
"userId": "<id:4>",
"userId": "<id:2>",
"originDeviceToken": null
}
]
@@ -46,7 +58,7 @@
{
"effect": "countOutstandingDosesToday",
"args": [
"<id:4>",
"<id:2>",
"UTC"
]
},
@@ -54,9 +66,9 @@
"effect": "notifyDelegatedIntake",
"args": [
{
"ownerId": "<id:4>",
"actorId": "<id:4>",
"medicationId": "<id:2>",
"ownerId": "<id:2>",
"actorId": "<id:2>",
"medicationId": "<id:3>",
"status": "taken"
}
]
@@ -65,8 +77,8 @@
"effect": "dispatchMedicationIntakeWebClear",
"args": [
{
"userId": "<id:4>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-15T08:00:00.000Z",
"badgeCount": 2
}
@@ -77,7 +89,7 @@
"medications": [
{
"id": "<id:5>",
"userId": "<id:4>",
"userId": "<id:2>",
"name": "As needed",
"dose": "10mg",
"treatmentClass": "GENERIC",
@@ -111,7 +123,7 @@
},
{
"id": "<id:6>",
"userId": "<id:4>",
"userId": "<id:2>",
"name": "Record only",
"dose": "10mg",
"treatmentClass": "GENERIC",
@@ -145,7 +157,7 @@
},
{
"id": "<id:7>",
"userId": "<id:4>",
"userId": "<id:2>",
"name": "Single shot",
"dose": "10mg",
"treatmentClass": "GENERIC",
@@ -178,8 +190,8 @@
"updatedAt": "<updatedAt>"
},
{
"id": "<id:2>",
"userId": "<id:4>",
"id": "<id:3>",
"userId": "<id:2>",
"name": "Twice daily",
"dose": "10mg",
"treatmentClass": "GENERIC",
@@ -213,7 +225,7 @@
},
{
"id": "<id:8>",
"userId": "<id:4>",
"userId": "<id:2>",
"name": "Weekly pen",
"dose": "10mg",
"treatmentClass": "GENERIC",
@@ -272,7 +284,7 @@
},
{
"id": "<id:10>",
"medicationId": "<id:2>",
"medicationId": "<id:3>",
"windowStart": "08:00",
"windowEnd": "10:00",
"label": null,
@@ -332,7 +344,7 @@
},
{
"id": "<id:13>",
"medicationId": "<id:2>",
"medicationId": "<id:3>",
"windowStart": "20:00",
"windowEnd": "22:00",
"label": null,
@@ -357,8 +369,8 @@
"intakes": [
{
"id": "<id:14>",
"userId": "<id:4>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-12T20:00:00.000Z",
"takenAt": null,
"skipped": true,
@@ -378,8 +390,8 @@
},
{
"id": "<id:15>",
"userId": "<id:4>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-13T08:00:00.000Z",
"takenAt": null,
"skipped": false,
@@ -399,8 +411,8 @@
},
{
"id": "<id:16>",
"userId": "<id:4>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-14T20:00:00.000Z",
"takenAt": "2026-10-14T20:05:00.000Z",
"skipped": false,
@@ -420,8 +432,8 @@
},
{
"id": "<id:1>",
"userId": "<id:4>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-15T08:00:00.000Z",
"takenAt": "2026-10-15T08:30:00.000Z",
"skipped": false,
@@ -436,7 +448,7 @@
"inventoryConsumption": [
{
"units": 1,
"itemId": "<id:3>"
"itemId": "<id:4>"
}
],
"externalId": null,
@@ -448,9 +460,9 @@
"doseChanges": [],
"inventoryItems": [
{
"id": "<id:3>",
"userId": "<id:4>",
"medicationId": "<id:2>",
"id": "<id:4>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"state": "IN_USE",
"containerType": "OTHER",
"unitsTotal": "30",
@@ -473,10 +485,10 @@
"audit": [
{
"action": "medication.intake",
"userId": "<id:4>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:2>",
"medicationId": "<id:3>",
"eventId": "<id:1>",
"skipped": false
},
@@ -3,12 +3,24 @@
"body": {
"data": {
"id": "<id:1>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"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": "<createdAt>"
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
"error": null
},
@@ -21,7 +33,7 @@
"entity_id": "<id:1>"
},
"meta": {
"medication_id": "<id:2>",
"medication_id": "<id:3>",
"skipped": true
},
"warnings": null,
@@ -33,7 +45,7 @@
"effect": "queueMedicationIntakeSync",
"args": [
{
"userId": "<id:3>",
"userId": "<id:2>",
"originDeviceToken": null
}
]
@@ -41,7 +53,7 @@
{
"effect": "countOutstandingDosesToday",
"args": [
"<id:3>",
"<id:2>",
"UTC"
]
},
@@ -49,9 +61,9 @@
"effect": "notifyDelegatedIntake",
"args": [
{
"ownerId": "<id:3>",
"actorId": "<id:3>",
"medicationId": "<id:2>",
"ownerId": "<id:2>",
"actorId": "<id:2>",
"medicationId": "<id:3>",
"status": "skipped"
}
]
@@ -60,8 +72,8 @@
"effect": "dispatchMedicationIntakeWebClear",
"args": [
{
"userId": "<id:3>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-15T20:00:00.000Z",
"badgeCount": 2
}
@@ -72,7 +84,7 @@
"medications": [
{
"id": "<id:4>",
"userId": "<id:3>",
"userId": "<id:2>",
"name": "As needed",
"dose": "10mg",
"treatmentClass": "GENERIC",
@@ -106,7 +118,7 @@
},
{
"id": "<id:5>",
"userId": "<id:3>",
"userId": "<id:2>",
"name": "Record only",
"dose": "10mg",
"treatmentClass": "GENERIC",
@@ -140,7 +152,7 @@
},
{
"id": "<id:6>",
"userId": "<id:3>",
"userId": "<id:2>",
"name": "Single shot",
"dose": "10mg",
"treatmentClass": "GENERIC",
@@ -173,8 +185,8 @@
"updatedAt": "<updatedAt>"
},
{
"id": "<id:2>",
"userId": "<id:3>",
"id": "<id:3>",
"userId": "<id:2>",
"name": "Twice daily",
"dose": "10mg",
"treatmentClass": "GENERIC",
@@ -208,7 +220,7 @@
},
{
"id": "<id:7>",
"userId": "<id:3>",
"userId": "<id:2>",
"name": "Weekly pen",
"dose": "10mg",
"treatmentClass": "GENERIC",
@@ -267,7 +279,7 @@
},
{
"id": "<id:9>",
"medicationId": "<id:2>",
"medicationId": "<id:3>",
"windowStart": "08:00",
"windowEnd": "10:00",
"label": null,
@@ -327,7 +339,7 @@
},
{
"id": "<id:12>",
"medicationId": "<id:2>",
"medicationId": "<id:3>",
"windowStart": "20:00",
"windowEnd": "22:00",
"label": null,
@@ -352,8 +364,8 @@
"intakes": [
{
"id": "<id:13>",
"userId": "<id:3>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-12T20:00:00.000Z",
"takenAt": null,
"skipped": true,
@@ -373,8 +385,8 @@
},
{
"id": "<id:14>",
"userId": "<id:3>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-13T08:00:00.000Z",
"takenAt": null,
"skipped": false,
@@ -394,8 +406,8 @@
},
{
"id": "<id:15>",
"userId": "<id:3>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-14T20:00:00.000Z",
"takenAt": "2026-10-14T20:05:00.000Z",
"skipped": false,
@@ -415,8 +427,8 @@
},
{
"id": "<id:16>",
"userId": "<id:3>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-15T08:00:00.000Z",
"takenAt": "2026-10-15T08:30:00.000Z",
"skipped": false,
@@ -441,7 +453,7 @@
},
{
"id": "<id:18>",
"userId": "<id:3>",
"userId": "<id:2>",
"medicationId": "<id:4>",
"scheduledFor": "2026-10-15T11:00:00.000Z",
"takenAt": "2026-10-15T11:00:00.000Z",
@@ -462,8 +474,8 @@
},
{
"id": "<id:1>",
"userId": "<id:3>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-15T20:00:00.000Z",
"takenAt": null,
"skipped": true,
@@ -486,8 +498,8 @@
"inventoryItems": [
{
"id": "<id:17>",
"userId": "<id:3>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"state": "IN_USE",
"containerType": "OTHER",
"unitsTotal": "30",
@@ -510,10 +522,10 @@
"audit": [
{
"action": "medication.intake",
"userId": "<id:3>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:2>",
"medicationId": "<id:3>",
"eventId": "<id:16>",
"skipped": false
},
@@ -521,7 +533,7 @@
},
{
"action": "medication.intake",
"userId": "<id:3>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:4>",
@@ -532,10 +544,10 @@
},
{
"action": "medication.intake",
"userId": "<id:3>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:2>",
"medicationId": "<id:3>",
"eventId": "<id:1>",
"skipped": true
},
@@ -3,12 +3,29 @@
"body": {
"data": {
"id": "<id:1>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"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": "<createdAt>"
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": [
{
"units": 1,
"itemId": "<id:4>"
}
],
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
"error": null
},
@@ -21,10 +38,10 @@
"entity_id": "<id:1>"
},
"meta": {
"medication_id": "<id:2>",
"medication_id": "<id:3>",
"units": 1,
"item_ids": [
"<id:3>"
"<id:4>"
],
"skipped": true
},
@@ -37,7 +54,7 @@
"effect": "queueMedicationIntakeSync",
"args": [
{
"userId": "<id:4>",
"userId": "<id:2>",
"originDeviceToken": null
}
]
@@ -45,7 +62,7 @@
{
"effect": "countOutstandingDosesToday",
"args": [
"<id:4>",
"<id:2>",
"UTC"
]
},
@@ -53,9 +70,9 @@
"effect": "notifyDelegatedIntake",
"args": [
{
"ownerId": "<id:4>",
"actorId": "<id:4>",
"medicationId": "<id:2>",
"ownerId": "<id:2>",
"actorId": "<id:2>",
"medicationId": "<id:3>",
"status": "skipped"
}
]
@@ -64,8 +81,8 @@
"effect": "dispatchMedicationIntakeWebClear",
"args": [
{
"userId": "<id:4>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-15T08:00:00.000Z",
"badgeCount": 2
}
@@ -76,7 +93,7 @@
"medications": [
{
"id": "<id:5>",
"userId": "<id:4>",
"userId": "<id:2>",
"name": "As needed",
"dose": "10mg",
"treatmentClass": "GENERIC",
@@ -110,7 +127,7 @@
},
{
"id": "<id:6>",
"userId": "<id:4>",
"userId": "<id:2>",
"name": "Record only",
"dose": "10mg",
"treatmentClass": "GENERIC",
@@ -144,7 +161,7 @@
},
{
"id": "<id:7>",
"userId": "<id:4>",
"userId": "<id:2>",
"name": "Single shot",
"dose": "10mg",
"treatmentClass": "GENERIC",
@@ -177,8 +194,8 @@
"updatedAt": "<updatedAt>"
},
{
"id": "<id:2>",
"userId": "<id:4>",
"id": "<id:3>",
"userId": "<id:2>",
"name": "Twice daily",
"dose": "10mg",
"treatmentClass": "GENERIC",
@@ -212,7 +229,7 @@
},
{
"id": "<id:8>",
"userId": "<id:4>",
"userId": "<id:2>",
"name": "Weekly pen",
"dose": "10mg",
"treatmentClass": "GENERIC",
@@ -271,7 +288,7 @@
},
{
"id": "<id:10>",
"medicationId": "<id:2>",
"medicationId": "<id:3>",
"windowStart": "08:00",
"windowEnd": "10:00",
"label": null,
@@ -331,7 +348,7 @@
},
{
"id": "<id:13>",
"medicationId": "<id:2>",
"medicationId": "<id:3>",
"windowStart": "20:00",
"windowEnd": "22:00",
"label": null,
@@ -356,8 +373,8 @@
"intakes": [
{
"id": "<id:14>",
"userId": "<id:4>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-12T20:00:00.000Z",
"takenAt": null,
"skipped": true,
@@ -377,8 +394,8 @@
},
{
"id": "<id:15>",
"userId": "<id:4>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-13T08:00:00.000Z",
"takenAt": null,
"skipped": false,
@@ -398,8 +415,8 @@
},
{
"id": "<id:16>",
"userId": "<id:4>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-14T20:00:00.000Z",
"takenAt": "2026-10-14T20:05:00.000Z",
"skipped": false,
@@ -419,8 +436,8 @@
},
{
"id": "<id:1>",
"userId": "<id:4>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-15T08:00:00.000Z",
"takenAt": null,
"skipped": true,
@@ -440,7 +457,7 @@
},
{
"id": "<id:17>",
"userId": "<id:4>",
"userId": "<id:2>",
"medicationId": "<id:5>",
"scheduledFor": "2026-10-15T11:00:00.000Z",
"takenAt": "2026-10-15T11:00:00.000Z",
@@ -461,8 +478,8 @@
},
{
"id": "<id:18>",
"userId": "<id:4>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-15T20:00:00.000Z",
"takenAt": null,
"skipped": true,
@@ -484,9 +501,9 @@
"doseChanges": [],
"inventoryItems": [
{
"id": "<id:3>",
"userId": "<id:4>",
"medicationId": "<id:2>",
"id": "<id:4>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"state": "IN_USE",
"containerType": "OTHER",
"unitsTotal": "30",
@@ -509,10 +526,10 @@
"audit": [
{
"action": "medication.intake",
"userId": "<id:4>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:2>",
"medicationId": "<id:3>",
"eventId": "<id:1>",
"skipped": false
},
@@ -520,7 +537,7 @@
},
{
"action": "medication.intake",
"userId": "<id:4>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:5>",
@@ -531,10 +548,10 @@
},
{
"action": "medication.intake",
"userId": "<id:4>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:2>",
"medicationId": "<id:3>",
"eventId": "<id:18>",
"skipped": true
},
@@ -542,10 +559,10 @@
},
{
"action": "medication.intake",
"userId": "<id:4>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:2>",
"medicationId": "<id:3>",
"eventId": "<id:1>",
"skipped": true
},
@@ -3,12 +3,24 @@
"body": {
"data": {
"id": "<id:1>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"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": "<createdAt>"
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": [],
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
"error": null
},
@@ -21,7 +33,7 @@
"entity_id": "<id:1>"
},
"meta": {
"medication_id": "<id:2>",
"medication_id": "<id:3>",
"skipped": true
},
"warnings": null,
@@ -33,7 +45,7 @@
"effect": "queueMedicationIntakeSync",
"args": [
{
"userId": "<id:3>",
"userId": "<id:2>",
"originDeviceToken": null
}
]
@@ -41,7 +53,7 @@
{
"effect": "countOutstandingDosesToday",
"args": [
"<id:3>",
"<id:2>",
"UTC"
]
},
@@ -49,9 +61,9 @@
"effect": "notifyDelegatedIntake",
"args": [
{
"ownerId": "<id:3>",
"actorId": "<id:3>",
"medicationId": "<id:2>",
"ownerId": "<id:2>",
"actorId": "<id:2>",
"medicationId": "<id:3>",
"status": "skipped"
}
]
@@ -60,8 +72,8 @@
"effect": "dispatchMedicationIntakeWebClear",
"args": [
{
"userId": "<id:3>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-15T11:00:00.000Z",
"badgeCount": 2
}
@@ -71,8 +83,8 @@
"stored": {
"medications": [
{
"id": "<id:2>",
"userId": "<id:3>",
"id": "<id:3>",
"userId": "<id:2>",
"name": "As needed",
"dose": "10mg",
"treatmentClass": "GENERIC",
@@ -106,7 +118,7 @@
},
{
"id": "<id:4>",
"userId": "<id:3>",
"userId": "<id:2>",
"name": "Record only",
"dose": "10mg",
"treatmentClass": "GENERIC",
@@ -140,7 +152,7 @@
},
{
"id": "<id:5>",
"userId": "<id:3>",
"userId": "<id:2>",
"name": "Single shot",
"dose": "10mg",
"treatmentClass": "GENERIC",
@@ -174,7 +186,7 @@
},
{
"id": "<id:6>",
"userId": "<id:3>",
"userId": "<id:2>",
"name": "Twice daily",
"dose": "10mg",
"treatmentClass": "GENERIC",
@@ -208,7 +220,7 @@
},
{
"id": "<id:7>",
"userId": "<id:3>",
"userId": "<id:2>",
"name": "Weekly pen",
"dose": "10mg",
"treatmentClass": "GENERIC",
@@ -352,7 +364,7 @@
"intakes": [
{
"id": "<id:13>",
"userId": "<id:3>",
"userId": "<id:2>",
"medicationId": "<id:6>",
"scheduledFor": "2026-10-12T20:00:00.000Z",
"takenAt": null,
@@ -373,7 +385,7 @@
},
{
"id": "<id:14>",
"userId": "<id:3>",
"userId": "<id:2>",
"medicationId": "<id:6>",
"scheduledFor": "2026-10-13T08:00:00.000Z",
"takenAt": null,
@@ -394,7 +406,7 @@
},
{
"id": "<id:15>",
"userId": "<id:3>",
"userId": "<id:2>",
"medicationId": "<id:6>",
"scheduledFor": "2026-10-14T20:00:00.000Z",
"takenAt": "2026-10-14T20:05:00.000Z",
@@ -415,7 +427,7 @@
},
{
"id": "<id:16>",
"userId": "<id:3>",
"userId": "<id:2>",
"medicationId": "<id:6>",
"scheduledFor": "2026-10-15T08:00:00.000Z",
"takenAt": null,
@@ -436,8 +448,8 @@
},
{
"id": "<id:1>",
"userId": "<id:3>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-15T11:00:00.000Z",
"takenAt": null,
"skipped": true,
@@ -457,7 +469,7 @@
},
{
"id": "<id:17>",
"userId": "<id:3>",
"userId": "<id:2>",
"medicationId": "<id:6>",
"scheduledFor": "2026-10-15T20:00:00.000Z",
"takenAt": null,
@@ -481,7 +493,7 @@
"inventoryItems": [
{
"id": "<id:18>",
"userId": "<id:3>",
"userId": "<id:2>",
"medicationId": "<id:6>",
"state": "IN_USE",
"containerType": "OTHER",
@@ -505,7 +517,7 @@
"audit": [
{
"action": "medication.intake",
"userId": "<id:3>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:6>",
@@ -516,10 +528,10 @@
},
{
"action": "medication.intake",
"userId": "<id:3>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:2>",
"medicationId": "<id:3>",
"eventId": "<id:1>",
"skipped": false
},
@@ -527,7 +539,7 @@
},
{
"action": "medication.intake",
"userId": "<id:3>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:6>",
@@ -538,7 +550,7 @@
},
{
"action": "medication.intake",
"userId": "<id:3>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:6>",
@@ -549,10 +561,10 @@
},
{
"action": "medication.intake",
"userId": "<id:3>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:2>",
"medicationId": "<id:3>",
"eventId": "<id:1>",
"skipped": true
},
@@ -560,10 +572,10 @@
},
{
"action": "medications.intake.update.refused",
"userId": "<id:3>",
"userId": "<id:2>",
"actorUserId": "<id:19>",
"details": {
"medicationId": "<id:2>",
"medicationId": "<id:3>",
"reason": "resolved_event"
},
"ipAddress": null
@@ -3,12 +3,24 @@
"body": {
"data": {
"id": "<id:1>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"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": "<createdAt>"
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
"error": null
},
@@ -21,10 +33,10 @@
"entity_id": "<id:1>"
},
"meta": {
"medication_id": "<id:2>",
"medication_id": "<id:3>",
"units": 1,
"item_ids": [
"<id:3>"
"<id:4>"
],
"auto_opened": 0,
"skipped": false
@@ -38,7 +50,7 @@
"effect": "queueMedicationIntakeSync",
"args": [
{
"userId": "<id:4>",
"userId": "<id:2>",
"originDeviceToken": null
}
]
@@ -46,7 +58,7 @@
{
"effect": "countOutstandingDosesToday",
"args": [
"<id:4>",
"<id:2>",
"UTC"
]
},
@@ -54,9 +66,9 @@
"effect": "notifyDelegatedIntake",
"args": [
{
"ownerId": "<id:4>",
"actorId": "<id:4>",
"medicationId": "<id:2>",
"ownerId": "<id:2>",
"actorId": "<id:2>",
"medicationId": "<id:3>",
"status": "taken"
}
]
@@ -65,8 +77,8 @@
"effect": "dispatchMedicationIntakeWebClear",
"args": [
{
"userId": "<id:4>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-14T08:00:00.000Z",
"badgeCount": 2
}
@@ -77,7 +89,7 @@
"medications": [
{
"id": "<id:5>",
"userId": "<id:4>",
"userId": "<id:2>",
"name": "As needed",
"dose": "10mg",
"treatmentClass": "GENERIC",
@@ -111,7 +123,7 @@
},
{
"id": "<id:6>",
"userId": "<id:4>",
"userId": "<id:2>",
"name": "Record only",
"dose": "10mg",
"treatmentClass": "GENERIC",
@@ -145,7 +157,7 @@
},
{
"id": "<id:7>",
"userId": "<id:4>",
"userId": "<id:2>",
"name": "Single shot",
"dose": "10mg",
"treatmentClass": "GENERIC",
@@ -178,8 +190,8 @@
"updatedAt": "<updatedAt>"
},
{
"id": "<id:2>",
"userId": "<id:4>",
"id": "<id:3>",
"userId": "<id:2>",
"name": "Twice daily",
"dose": "10mg",
"treatmentClass": "GENERIC",
@@ -213,7 +225,7 @@
},
{
"id": "<id:8>",
"userId": "<id:4>",
"userId": "<id:2>",
"name": "Weekly pen",
"dose": "10mg",
"treatmentClass": "GENERIC",
@@ -272,7 +284,7 @@
},
{
"id": "<id:10>",
"medicationId": "<id:2>",
"medicationId": "<id:3>",
"windowStart": "08:00",
"windowEnd": "10:00",
"label": null,
@@ -332,7 +344,7 @@
},
{
"id": "<id:13>",
"medicationId": "<id:2>",
"medicationId": "<id:3>",
"windowStart": "20:00",
"windowEnd": "22:00",
"label": null,
@@ -357,8 +369,8 @@
"intakes": [
{
"id": "<id:14>",
"userId": "<id:4>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-12T20:00:00.000Z",
"takenAt": null,
"skipped": true,
@@ -378,8 +390,8 @@
},
{
"id": "<id:15>",
"userId": "<id:4>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-13T08:00:00.000Z",
"takenAt": null,
"skipped": false,
@@ -399,8 +411,8 @@
},
{
"id": "<id:1>",
"userId": "<id:4>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-14T08:00:00.000Z",
"takenAt": "2026-10-14T11:00:00.000Z",
"skipped": false,
@@ -415,7 +427,7 @@
"inventoryConsumption": [
{
"units": 1,
"itemId": "<id:3>"
"itemId": "<id:4>"
}
],
"externalId": null,
@@ -425,8 +437,8 @@
},
{
"id": "<id:16>",
"userId": "<id:4>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-14T20:00:00.000Z",
"takenAt": "2026-10-14T20:05:00.000Z",
"skipped": false,
@@ -446,8 +458,8 @@
},
{
"id": "<id:17>",
"userId": "<id:4>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-15T08:00:00.000Z",
"takenAt": null,
"skipped": true,
@@ -467,7 +479,7 @@
},
{
"id": "<id:18>",
"userId": "<id:4>",
"userId": "<id:2>",
"medicationId": "<id:5>",
"scheduledFor": "2026-10-15T11:00:00.000Z",
"takenAt": null,
@@ -488,8 +500,8 @@
},
{
"id": "<id:19>",
"userId": "<id:4>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-15T20:00:00.000Z",
"takenAt": null,
"skipped": true,
@@ -511,9 +523,9 @@
"doseChanges": [],
"inventoryItems": [
{
"id": "<id:3>",
"userId": "<id:4>",
"medicationId": "<id:2>",
"id": "<id:4>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"state": "IN_USE",
"containerType": "OTHER",
"unitsTotal": "30",
@@ -536,10 +548,10 @@
"audit": [
{
"action": "medication.intake",
"userId": "<id:4>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:2>",
"medicationId": "<id:3>",
"eventId": "<id:17>",
"skipped": false
},
@@ -547,7 +559,7 @@
},
{
"action": "medication.intake",
"userId": "<id:4>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:5>",
@@ -558,10 +570,10 @@
},
{
"action": "medication.intake",
"userId": "<id:4>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:2>",
"medicationId": "<id:3>",
"eventId": "<id:1>",
"skipped": false
},
@@ -569,10 +581,10 @@
},
{
"action": "medication.intake",
"userId": "<id:4>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:2>",
"medicationId": "<id:3>",
"eventId": "<id:19>",
"skipped": true
},
@@ -580,10 +592,10 @@
},
{
"action": "medication.intake",
"userId": "<id:4>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:2>",
"medicationId": "<id:3>",
"eventId": "<id:17>",
"skipped": true
},
@@ -591,7 +603,7 @@
},
{
"action": "medication.intake",
"userId": "<id:4>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:5>",
@@ -602,7 +614,7 @@
},
{
"action": "medications.intake.update.refused",
"userId": "<id:4>",
"userId": "<id:2>",
"actorUserId": "<id:20>",
"details": {
"medicationId": "<id:5>",
@@ -3,12 +3,24 @@
"body": {
"data": {
"id": "<id:1>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"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": "<createdAt>"
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
"error": null
},
@@ -21,10 +33,10 @@
"entity_id": "<id:1>"
},
"meta": {
"medication_id": "<id:2>",
"medication_id": "<id:3>",
"units": 1,
"item_ids": [
"<id:3>"
"<id:4>"
],
"auto_opened": 0,
"skipped": false
@@ -38,7 +50,7 @@
"effect": "queueMedicationIntakeSync",
"args": [
{
"userId": "<id:4>",
"userId": "<id:2>",
"originDeviceToken": null
}
]
@@ -46,7 +58,7 @@
{
"effect": "countOutstandingDosesToday",
"args": [
"<id:4>",
"<id:2>",
"UTC"
]
},
@@ -54,9 +66,9 @@
"effect": "notifyDelegatedIntake",
"args": [
{
"ownerId": "<id:4>",
"actorId": "<id:4>",
"medicationId": "<id:2>",
"ownerId": "<id:2>",
"actorId": "<id:2>",
"medicationId": "<id:3>",
"status": "taken"
}
]
@@ -65,8 +77,8 @@
"effect": "dispatchMedicationIntakeWebClear",
"args": [
{
"userId": "<id:4>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-13T08:00:00.000Z",
"badgeCount": 2
}
@@ -77,7 +89,7 @@
"medications": [
{
"id": "<id:5>",
"userId": "<id:4>",
"userId": "<id:2>",
"name": "As needed",
"dose": "10mg",
"treatmentClass": "GENERIC",
@@ -111,7 +123,7 @@
},
{
"id": "<id:6>",
"userId": "<id:4>",
"userId": "<id:2>",
"name": "Record only",
"dose": "10mg",
"treatmentClass": "GENERIC",
@@ -145,7 +157,7 @@
},
{
"id": "<id:7>",
"userId": "<id:4>",
"userId": "<id:2>",
"name": "Single shot",
"dose": "10mg",
"treatmentClass": "GENERIC",
@@ -178,8 +190,8 @@
"updatedAt": "<updatedAt>"
},
{
"id": "<id:2>",
"userId": "<id:4>",
"id": "<id:3>",
"userId": "<id:2>",
"name": "Twice daily",
"dose": "10mg",
"treatmentClass": "GENERIC",
@@ -213,7 +225,7 @@
},
{
"id": "<id:8>",
"userId": "<id:4>",
"userId": "<id:2>",
"name": "Weekly pen",
"dose": "10mg",
"treatmentClass": "GENERIC",
@@ -272,7 +284,7 @@
},
{
"id": "<id:10>",
"medicationId": "<id:2>",
"medicationId": "<id:3>",
"windowStart": "08:00",
"windowEnd": "10:00",
"label": null,
@@ -332,7 +344,7 @@
},
{
"id": "<id:13>",
"medicationId": "<id:2>",
"medicationId": "<id:3>",
"windowStart": "20:00",
"windowEnd": "22:00",
"label": null,
@@ -357,8 +369,8 @@
"intakes": [
{
"id": "<id:14>",
"userId": "<id:4>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-12T20:00:00.000Z",
"takenAt": null,
"skipped": true,
@@ -378,8 +390,8 @@
},
{
"id": "<id:1>",
"userId": "<id:4>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-13T08:00:00.000Z",
"takenAt": "2026-10-15T11:30:00.000Z",
"skipped": false,
@@ -394,7 +406,7 @@
"inventoryConsumption": [
{
"units": 1,
"itemId": "<id:3>"
"itemId": "<id:4>"
}
],
"externalId": null,
@@ -404,8 +416,8 @@
},
{
"id": "<id:15>",
"userId": "<id:4>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-14T08:00:00.000Z",
"takenAt": "2026-10-14T11:00:00.000Z",
"skipped": false,
@@ -420,7 +432,7 @@
"inventoryConsumption": [
{
"units": 1,
"itemId": "<id:3>"
"itemId": "<id:4>"
}
],
"externalId": null,
@@ -430,8 +442,8 @@
},
{
"id": "<id:16>",
"userId": "<id:4>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-14T20:00:00.000Z",
"takenAt": "2026-10-14T20:05:00.000Z",
"skipped": false,
@@ -451,8 +463,8 @@
},
{
"id": "<id:17>",
"userId": "<id:4>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-15T08:00:00.000Z",
"takenAt": null,
"skipped": true,
@@ -472,7 +484,7 @@
},
{
"id": "<id:18>",
"userId": "<id:4>",
"userId": "<id:2>",
"medicationId": "<id:5>",
"scheduledFor": "2026-10-15T11:00:00.000Z",
"takenAt": null,
@@ -493,8 +505,8 @@
},
{
"id": "<id:19>",
"userId": "<id:4>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-15T20:00:00.000Z",
"takenAt": null,
"skipped": true,
@@ -516,9 +528,9 @@
"doseChanges": [],
"inventoryItems": [
{
"id": "<id:3>",
"userId": "<id:4>",
"medicationId": "<id:2>",
"id": "<id:4>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"state": "IN_USE",
"containerType": "OTHER",
"unitsTotal": "30",
@@ -541,10 +553,10 @@
"audit": [
{
"action": "medication.intake",
"userId": "<id:4>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:2>",
"medicationId": "<id:3>",
"eventId": "<id:17>",
"skipped": false
},
@@ -552,7 +564,7 @@
},
{
"action": "medication.intake",
"userId": "<id:4>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:5>",
@@ -563,10 +575,10 @@
},
{
"action": "medication.intake",
"userId": "<id:4>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:2>",
"medicationId": "<id:3>",
"eventId": "<id:15>",
"skipped": false
},
@@ -574,10 +586,10 @@
},
{
"action": "medication.intake",
"userId": "<id:4>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:2>",
"medicationId": "<id:3>",
"eventId": "<id:1>",
"skipped": false
},
@@ -585,10 +597,10 @@
},
{
"action": "medication.intake",
"userId": "<id:4>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:2>",
"medicationId": "<id:3>",
"eventId": "<id:19>",
"skipped": true
},
@@ -596,10 +608,10 @@
},
{
"action": "medication.intake",
"userId": "<id:4>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:2>",
"medicationId": "<id:3>",
"eventId": "<id:17>",
"skipped": true
},
@@ -607,7 +619,7 @@
},
{
"action": "medication.intake",
"userId": "<id:4>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:5>",
@@ -618,7 +630,7 @@
},
{
"action": "medications.intake.update.refused",
"userId": "<id:4>",
"userId": "<id:2>",
"actorUserId": "<id:20>",
"details": {
"medicationId": "<id:5>",
@@ -3,12 +3,24 @@
"body": {
"data": {
"id": "<id:1>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"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": "<createdAt>"
"idempotencyKey": "dose-key-0001",
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
"error": null
},
@@ -21,10 +33,10 @@
"entity_id": "<id:1>"
},
"meta": {
"medication_id": "<id:2>",
"medication_id": "<id:3>",
"units": 1,
"item_ids": [
"<id:3>"
"<id:4>"
],
"auto_opened": 0,
"skipped": false
@@ -38,7 +50,7 @@
"effect": "queueMedicationIntakeSync",
"args": [
{
"userId": "<id:4>",
"userId": "<id:2>",
"originDeviceToken": null
}
]
@@ -46,7 +58,7 @@
{
"effect": "countOutstandingDosesToday",
"args": [
"<id:4>",
"<id:2>",
"UTC"
]
},
@@ -54,9 +66,9 @@
"effect": "notifyDelegatedIntake",
"args": [
{
"ownerId": "<id:4>",
"actorId": "<id:4>",
"medicationId": "<id:2>",
"ownerId": "<id:2>",
"actorId": "<id:2>",
"medicationId": "<id:3>",
"status": "taken"
}
]
@@ -65,8 +77,8 @@
"effect": "dispatchMedicationIntakeWebClear",
"args": [
{
"userId": "<id:4>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-13T20:00:00.000Z",
"badgeCount": 2
}
@@ -77,7 +89,7 @@
"medications": [
{
"id": "<id:5>",
"userId": "<id:4>",
"userId": "<id:2>",
"name": "As needed",
"dose": "10mg",
"treatmentClass": "GENERIC",
@@ -111,7 +123,7 @@
},
{
"id": "<id:6>",
"userId": "<id:4>",
"userId": "<id:2>",
"name": "Record only",
"dose": "10mg",
"treatmentClass": "GENERIC",
@@ -145,7 +157,7 @@
},
{
"id": "<id:7>",
"userId": "<id:4>",
"userId": "<id:2>",
"name": "Single shot",
"dose": "10mg",
"treatmentClass": "GENERIC",
@@ -178,8 +190,8 @@
"updatedAt": "<updatedAt>"
},
{
"id": "<id:2>",
"userId": "<id:4>",
"id": "<id:3>",
"userId": "<id:2>",
"name": "Twice daily",
"dose": "10mg",
"treatmentClass": "GENERIC",
@@ -213,7 +225,7 @@
},
{
"id": "<id:8>",
"userId": "<id:4>",
"userId": "<id:2>",
"name": "Weekly pen",
"dose": "10mg",
"treatmentClass": "GENERIC",
@@ -272,7 +284,7 @@
},
{
"id": "<id:10>",
"medicationId": "<id:2>",
"medicationId": "<id:3>",
"windowStart": "08:00",
"windowEnd": "10:00",
"label": null,
@@ -332,7 +344,7 @@
},
{
"id": "<id:13>",
"medicationId": "<id:2>",
"medicationId": "<id:3>",
"windowStart": "20:00",
"windowEnd": "22:00",
"label": null,
@@ -357,8 +369,8 @@
"intakes": [
{
"id": "<id:14>",
"userId": "<id:4>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-12T20:00:00.000Z",
"takenAt": null,
"skipped": true,
@@ -378,8 +390,8 @@
},
{
"id": "<id:15>",
"userId": "<id:4>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-13T08:00:00.000Z",
"takenAt": "2026-10-15T11:30:00.000Z",
"skipped": false,
@@ -394,7 +406,7 @@
"inventoryConsumption": [
{
"units": 1,
"itemId": "<id:3>"
"itemId": "<id:4>"
}
],
"externalId": null,
@@ -404,8 +416,8 @@
},
{
"id": "<id:1>",
"userId": "<id:4>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-13T20:00:00.000Z",
"takenAt": "2026-10-13T20:30:00.000Z",
"skipped": false,
@@ -420,7 +432,7 @@
"inventoryConsumption": [
{
"units": 1,
"itemId": "<id:3>"
"itemId": "<id:4>"
}
],
"externalId": null,
@@ -430,8 +442,8 @@
},
{
"id": "<id:16>",
"userId": "<id:4>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-14T08:00:00.000Z",
"takenAt": "2026-10-14T11:00:00.000Z",
"skipped": false,
@@ -446,7 +458,7 @@
"inventoryConsumption": [
{
"units": 1,
"itemId": "<id:3>"
"itemId": "<id:4>"
}
],
"externalId": null,
@@ -456,8 +468,8 @@
},
{
"id": "<id:17>",
"userId": "<id:4>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-14T20:00:00.000Z",
"takenAt": "2026-10-14T20:05:00.000Z",
"skipped": false,
@@ -477,8 +489,8 @@
},
{
"id": "<id:18>",
"userId": "<id:4>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-15T08:00:00.000Z",
"takenAt": null,
"skipped": true,
@@ -498,7 +510,7 @@
},
{
"id": "<id:19>",
"userId": "<id:4>",
"userId": "<id:2>",
"medicationId": "<id:5>",
"scheduledFor": "2026-10-15T11:00:00.000Z",
"takenAt": null,
@@ -519,8 +531,8 @@
},
{
"id": "<id:20>",
"userId": "<id:4>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-15T20:00:00.000Z",
"takenAt": null,
"skipped": true,
@@ -542,9 +554,9 @@
"doseChanges": [],
"inventoryItems": [
{
"id": "<id:3>",
"userId": "<id:4>",
"medicationId": "<id:2>",
"id": "<id:4>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"state": "IN_USE",
"containerType": "OTHER",
"unitsTotal": "30",
@@ -567,10 +579,10 @@
"audit": [
{
"action": "medication.intake",
"userId": "<id:4>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:2>",
"medicationId": "<id:3>",
"eventId": "<id:18>",
"skipped": false
},
@@ -578,7 +590,7 @@
},
{
"action": "medication.intake",
"userId": "<id:4>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:5>",
@@ -589,10 +601,10 @@
},
{
"action": "medication.intake",
"userId": "<id:4>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:2>",
"medicationId": "<id:3>",
"eventId": "<id:16>",
"skipped": false
},
@@ -600,10 +612,10 @@
},
{
"action": "medication.intake",
"userId": "<id:4>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:2>",
"medicationId": "<id:3>",
"eventId": "<id:15>",
"skipped": false
},
@@ -611,10 +623,10 @@
},
{
"action": "medication.intake",
"userId": "<id:4>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:2>",
"medicationId": "<id:3>",
"eventId": "<id:1>",
"skipped": false
},
@@ -622,10 +634,10 @@
},
{
"action": "medication.intake",
"userId": "<id:4>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:2>",
"medicationId": "<id:3>",
"eventId": "<id:20>",
"skipped": true
},
@@ -633,10 +645,10 @@
},
{
"action": "medication.intake",
"userId": "<id:4>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:2>",
"medicationId": "<id:3>",
"eventId": "<id:18>",
"skipped": true
},
@@ -644,7 +656,7 @@
},
{
"action": "medication.intake",
"userId": "<id:4>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:5>",
@@ -655,7 +667,7 @@
},
{
"action": "medications.intake.update.refused",
"userId": "<id:4>",
"userId": "<id:2>",
"actorUserId": "<id:21>",
"details": {
"medicationId": "<id:5>",
@@ -3,12 +3,24 @@
"body": {
"data": {
"id": "<id:1>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"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": "<createdAt>"
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
"error": null
},
@@ -21,10 +33,10 @@
"entity_id": "<id:1>"
},
"meta": {
"medication_id": "<id:2>",
"medication_id": "<id:3>",
"units": 1,
"item_ids": [
"<id:3>"
"<id:4>"
],
"auto_opened": 0,
"skipped": false
@@ -38,7 +50,7 @@
"effect": "queueMedicationIntakeSync",
"args": [
{
"userId": "<id:4>",
"userId": "<id:2>",
"originDeviceToken": null
}
]
@@ -46,7 +58,7 @@
{
"effect": "countOutstandingDosesToday",
"args": [
"<id:4>",
"<id:2>",
"UTC"
]
},
@@ -54,9 +66,9 @@
"effect": "notifyDelegatedIntake",
"args": [
{
"ownerId": "<id:4>",
"actorId": "<id:4>",
"medicationId": "<id:2>",
"ownerId": "<id:2>",
"actorId": "<id:2>",
"medicationId": "<id:3>",
"status": "taken"
}
]
@@ -65,8 +77,8 @@
"effect": "dispatchMedicationIntakeWebClear",
"args": [
{
"userId": "<id:4>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-12T08:00:00.000Z",
"badgeCount": 2
}
@@ -77,7 +89,7 @@
"medications": [
{
"id": "<id:5>",
"userId": "<id:4>",
"userId": "<id:2>",
"name": "As needed",
"dose": "10mg",
"treatmentClass": "GENERIC",
@@ -111,7 +123,7 @@
},
{
"id": "<id:6>",
"userId": "<id:4>",
"userId": "<id:2>",
"name": "Record only",
"dose": "10mg",
"treatmentClass": "GENERIC",
@@ -145,7 +157,7 @@
},
{
"id": "<id:7>",
"userId": "<id:4>",
"userId": "<id:2>",
"name": "Single shot",
"dose": "10mg",
"treatmentClass": "GENERIC",
@@ -178,8 +190,8 @@
"updatedAt": "<updatedAt>"
},
{
"id": "<id:2>",
"userId": "<id:4>",
"id": "<id:3>",
"userId": "<id:2>",
"name": "Twice daily",
"dose": "10mg",
"treatmentClass": "GENERIC",
@@ -213,7 +225,7 @@
},
{
"id": "<id:8>",
"userId": "<id:4>",
"userId": "<id:2>",
"name": "Weekly pen",
"dose": "10mg",
"treatmentClass": "GENERIC",
@@ -272,7 +284,7 @@
},
{
"id": "<id:10>",
"medicationId": "<id:2>",
"medicationId": "<id:3>",
"windowStart": "08:00",
"windowEnd": "10:00",
"label": null,
@@ -332,7 +344,7 @@
},
{
"id": "<id:13>",
"medicationId": "<id:2>",
"medicationId": "<id:3>",
"windowStart": "20:00",
"windowEnd": "22:00",
"label": null,
@@ -357,8 +369,8 @@
"intakes": [
{
"id": "<id:1>",
"userId": "<id:4>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-12T08:00:00.000Z",
"takenAt": "2026-10-12T08:15:00.000Z",
"skipped": false,
@@ -373,7 +385,7 @@
"inventoryConsumption": [
{
"units": 1,
"itemId": "<id:3>"
"itemId": "<id:4>"
}
],
"externalId": null,
@@ -383,8 +395,8 @@
},
{
"id": "<id:14>",
"userId": "<id:4>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-12T20:00:00.000Z",
"takenAt": null,
"skipped": true,
@@ -404,8 +416,8 @@
},
{
"id": "<id:15>",
"userId": "<id:4>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-13T08:00:00.000Z",
"takenAt": "2026-10-15T11:30:00.000Z",
"skipped": false,
@@ -420,7 +432,7 @@
"inventoryConsumption": [
{
"units": 1,
"itemId": "<id:3>"
"itemId": "<id:4>"
}
],
"externalId": null,
@@ -430,8 +442,8 @@
},
{
"id": "<id:16>",
"userId": "<id:4>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-13T20:00:00.000Z",
"takenAt": "2026-10-13T20:30:00.000Z",
"skipped": false,
@@ -446,7 +458,7 @@
"inventoryConsumption": [
{
"units": 1,
"itemId": "<id:3>"
"itemId": "<id:4>"
}
],
"externalId": null,
@@ -456,8 +468,8 @@
},
{
"id": "<id:17>",
"userId": "<id:4>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-14T08:00:00.000Z",
"takenAt": "2026-10-14T11:00:00.000Z",
"skipped": false,
@@ -472,7 +484,7 @@
"inventoryConsumption": [
{
"units": 1,
"itemId": "<id:3>"
"itemId": "<id:4>"
}
],
"externalId": null,
@@ -482,8 +494,8 @@
},
{
"id": "<id:18>",
"userId": "<id:4>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-14T20:00:00.000Z",
"takenAt": "2026-10-14T20:05:00.000Z",
"skipped": false,
@@ -503,8 +515,8 @@
},
{
"id": "<id:19>",
"userId": "<id:4>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-15T08:00:00.000Z",
"takenAt": null,
"skipped": true,
@@ -524,7 +536,7 @@
},
{
"id": "<id:20>",
"userId": "<id:4>",
"userId": "<id:2>",
"medicationId": "<id:5>",
"scheduledFor": "2026-10-15T11:00:00.000Z",
"takenAt": null,
@@ -545,8 +557,8 @@
},
{
"id": "<id:21>",
"userId": "<id:4>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-15T20:00:00.000Z",
"takenAt": null,
"skipped": true,
@@ -568,9 +580,9 @@
"doseChanges": [],
"inventoryItems": [
{
"id": "<id:3>",
"userId": "<id:4>",
"medicationId": "<id:2>",
"id": "<id:4>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"state": "IN_USE",
"containerType": "OTHER",
"unitsTotal": "30",
@@ -593,10 +605,10 @@
"audit": [
{
"action": "medication.intake",
"userId": "<id:4>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:2>",
"medicationId": "<id:3>",
"eventId": "<id:19>",
"skipped": false
},
@@ -604,7 +616,7 @@
},
{
"action": "medication.intake",
"userId": "<id:4>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:5>",
@@ -615,10 +627,10 @@
},
{
"action": "medication.intake",
"userId": "<id:4>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:2>",
"medicationId": "<id:3>",
"eventId": "<id:17>",
"skipped": false
},
@@ -626,10 +638,10 @@
},
{
"action": "medication.intake",
"userId": "<id:4>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:2>",
"medicationId": "<id:3>",
"eventId": "<id:15>",
"skipped": false
},
@@ -637,10 +649,10 @@
},
{
"action": "medication.intake",
"userId": "<id:4>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:2>",
"medicationId": "<id:3>",
"eventId": "<id:16>",
"skipped": false
},
@@ -648,10 +660,10 @@
},
{
"action": "medication.intake",
"userId": "<id:4>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:2>",
"medicationId": "<id:3>",
"eventId": "<id:1>",
"skipped": false
},
@@ -659,10 +671,10 @@
},
{
"action": "medication.intake",
"userId": "<id:4>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:2>",
"medicationId": "<id:3>",
"eventId": "<id:21>",
"skipped": true
},
@@ -670,10 +682,10 @@
},
{
"action": "medication.intake",
"userId": "<id:4>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:2>",
"medicationId": "<id:3>",
"eventId": "<id:19>",
"skipped": true
},
@@ -681,7 +693,7 @@
},
{
"action": "medication.intake",
"userId": "<id:4>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:5>",
@@ -692,7 +704,7 @@
},
{
"action": "medications.intake.update.refused",
"userId": "<id:4>",
"userId": "<id:2>",
"actorUserId": "<id:22>",
"details": {
"medicationId": "<id:5>",
@@ -703,7 +715,7 @@
],
"idempotency": [
{
"userId": "<id:4>",
"userId": "<id:2>",
"key": "<id:23>",
"method": "POST",
"path": "/api/medications/<daily>/intake",
@@ -3,12 +3,24 @@
"body": {
"data": {
"id": "<id:1>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"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": "<createdAt>"
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
"error": null
},
@@ -30,8 +42,8 @@
"stored": {
"medications": [
{
"id": "<id:2>",
"userId": "<id:3>",
"id": "<id:4>",
"userId": "<id:2>",
"name": "As needed",
"dose": "10mg",
"treatmentClass": "GENERIC",
@@ -64,8 +76,8 @@
"updatedAt": "<updatedAt>"
},
{
"id": "<id:4>",
"userId": "<id:3>",
"id": "<id:5>",
"userId": "<id:2>",
"name": "Record only",
"dose": "10mg",
"treatmentClass": "GENERIC",
@@ -98,8 +110,8 @@
"updatedAt": "<updatedAt>"
},
{
"id": "<id:5>",
"userId": "<id:3>",
"id": "<id:6>",
"userId": "<id:2>",
"name": "Single shot",
"dose": "10mg",
"treatmentClass": "GENERIC",
@@ -132,8 +144,8 @@
"updatedAt": "<updatedAt>"
},
{
"id": "<id:6>",
"userId": "<id:3>",
"id": "<id:3>",
"userId": "<id:2>",
"name": "Twice daily",
"dose": "10mg",
"treatmentClass": "GENERIC",
@@ -167,7 +179,7 @@
},
{
"id": "<id:7>",
"userId": "<id:3>",
"userId": "<id:2>",
"name": "Weekly pen",
"dose": "10mg",
"treatmentClass": "GENERIC",
@@ -206,7 +218,7 @@
"schedules": [
{
"id": "<id:8>",
"medicationId": "<id:4>",
"medicationId": "<id:5>",
"windowStart": "07:00",
"windowEnd": "08:00",
"label": null,
@@ -226,7 +238,7 @@
},
{
"id": "<id:9>",
"medicationId": "<id:6>",
"medicationId": "<id:3>",
"windowStart": "08:00",
"windowEnd": "10:00",
"label": null,
@@ -266,7 +278,7 @@
},
{
"id": "<id:11>",
"medicationId": "<id:5>",
"medicationId": "<id:6>",
"windowStart": "09:00",
"windowEnd": "11:00",
"label": null,
@@ -286,7 +298,7 @@
},
{
"id": "<id:12>",
"medicationId": "<id:6>",
"medicationId": "<id:3>",
"windowStart": "20:00",
"windowEnd": "22:00",
"label": null,
@@ -311,8 +323,8 @@
"intakes": [
{
"id": "<id:1>",
"userId": "<id:3>",
"medicationId": "<id:6>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-12T08:00:00.000Z",
"takenAt": "2026-10-12T08:15:00.000Z",
"skipped": false,
@@ -337,8 +349,8 @@
},
{
"id": "<id:14>",
"userId": "<id:3>",
"medicationId": "<id:6>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-12T20:00:00.000Z",
"takenAt": null,
"skipped": true,
@@ -358,8 +370,8 @@
},
{
"id": "<id:15>",
"userId": "<id:3>",
"medicationId": "<id:6>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-13T08:00:00.000Z",
"takenAt": "2026-10-15T11:30:00.000Z",
"skipped": false,
@@ -384,8 +396,8 @@
},
{
"id": "<id:16>",
"userId": "<id:3>",
"medicationId": "<id:6>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-13T20:00:00.000Z",
"takenAt": "2026-10-13T20:30:00.000Z",
"skipped": false,
@@ -410,8 +422,8 @@
},
{
"id": "<id:17>",
"userId": "<id:3>",
"medicationId": "<id:6>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-14T08:00:00.000Z",
"takenAt": "2026-10-14T11:00:00.000Z",
"skipped": false,
@@ -436,8 +448,8 @@
},
{
"id": "<id:18>",
"userId": "<id:3>",
"medicationId": "<id:6>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-14T20:00:00.000Z",
"takenAt": "2026-10-14T20:05:00.000Z",
"skipped": false,
@@ -457,8 +469,8 @@
},
{
"id": "<id:19>",
"userId": "<id:3>",
"medicationId": "<id:6>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-15T08:00:00.000Z",
"takenAt": null,
"skipped": true,
@@ -478,8 +490,8 @@
},
{
"id": "<id:20>",
"userId": "<id:3>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:4>",
"scheduledFor": "2026-10-15T11:00:00.000Z",
"takenAt": null,
"skipped": true,
@@ -499,8 +511,8 @@
},
{
"id": "<id:21>",
"userId": "<id:3>",
"medicationId": "<id:6>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-15T20:00:00.000Z",
"takenAt": null,
"skipped": true,
@@ -523,8 +535,8 @@
"inventoryItems": [
{
"id": "<id:13>",
"userId": "<id:3>",
"medicationId": "<id:6>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"state": "IN_USE",
"containerType": "OTHER",
"unitsTotal": "30",
@@ -547,10 +559,10 @@
"audit": [
{
"action": "medication.intake",
"userId": "<id:3>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:6>",
"medicationId": "<id:3>",
"eventId": "<id:19>",
"skipped": false
},
@@ -558,10 +570,10 @@
},
{
"action": "medication.intake",
"userId": "<id:3>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:2>",
"medicationId": "<id:4>",
"eventId": "<id:20>",
"skipped": false
},
@@ -569,10 +581,10 @@
},
{
"action": "medication.intake",
"userId": "<id:3>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:6>",
"medicationId": "<id:3>",
"eventId": "<id:17>",
"skipped": false
},
@@ -580,10 +592,10 @@
},
{
"action": "medication.intake",
"userId": "<id:3>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:6>",
"medicationId": "<id:3>",
"eventId": "<id:15>",
"skipped": false
},
@@ -591,10 +603,10 @@
},
{
"action": "medication.intake",
"userId": "<id:3>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:6>",
"medicationId": "<id:3>",
"eventId": "<id:16>",
"skipped": false
},
@@ -602,10 +614,10 @@
},
{
"action": "medication.intake",
"userId": "<id:3>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:6>",
"medicationId": "<id:3>",
"eventId": "<id:1>",
"skipped": false
},
@@ -613,10 +625,10 @@
},
{
"action": "medication.intake",
"userId": "<id:3>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:6>",
"medicationId": "<id:3>",
"eventId": "<id:21>",
"skipped": true
},
@@ -624,10 +636,10 @@
},
{
"action": "medication.intake",
"userId": "<id:3>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:6>",
"medicationId": "<id:3>",
"eventId": "<id:19>",
"skipped": true
},
@@ -635,10 +647,10 @@
},
{
"action": "medication.intake",
"userId": "<id:3>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:2>",
"medicationId": "<id:4>",
"eventId": "<id:20>",
"skipped": true
},
@@ -646,10 +658,10 @@
},
{
"action": "medications.intake.update.refused",
"userId": "<id:3>",
"userId": "<id:2>",
"actorUserId": "<id:22>",
"details": {
"medicationId": "<id:2>",
"medicationId": "<id:4>",
"reason": "resolved_event"
},
"ipAddress": null
@@ -657,7 +669,7 @@
],
"idempotency": [
{
"userId": "<id:3>",
"userId": "<id:2>",
"key": "<id:23>",
"method": "POST",
"path": "/api/medications/<daily>/intake",
@@ -3,12 +3,24 @@
"body": {
"data": {
"id": "<id:1>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"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": "<createdAt>"
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
"error": null
},
@@ -21,10 +33,10 @@
"entity_id": "<id:1>"
},
"meta": {
"medication_id": "<id:2>",
"medication_id": "<id:3>",
"units": 1,
"item_ids": [
"<id:3>"
"<id:4>"
],
"auto_opened": 0,
"skipped": false
@@ -38,7 +50,7 @@
"effect": "queueMedicationIntakeSync",
"args": [
{
"userId": "<id:4>",
"userId": "<id:2>",
"originDeviceToken": null
}
]
@@ -46,7 +58,7 @@
{
"effect": "countOutstandingDosesToday",
"args": [
"<id:4>",
"<id:2>",
"UTC"
]
},
@@ -54,9 +66,9 @@
"effect": "notifyDelegatedIntake",
"args": [
{
"ownerId": "<id:4>",
"actorId": "<id:4>",
"medicationId": "<id:2>",
"ownerId": "<id:2>",
"actorId": "<id:2>",
"medicationId": "<id:3>",
"status": "taken"
}
]
@@ -65,8 +77,8 @@
"effect": "dispatchMedicationIntakeWebClear",
"args": [
{
"userId": "<id:4>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-11T20:00:00.000Z",
"badgeCount": 2
}
@@ -77,7 +89,7 @@
"medications": [
{
"id": "<id:5>",
"userId": "<id:4>",
"userId": "<id:2>",
"name": "As needed",
"dose": "10mg",
"treatmentClass": "GENERIC",
@@ -111,7 +123,7 @@
},
{
"id": "<id:6>",
"userId": "<id:4>",
"userId": "<id:2>",
"name": "Record only",
"dose": "10mg",
"treatmentClass": "GENERIC",
@@ -145,7 +157,7 @@
},
{
"id": "<id:7>",
"userId": "<id:4>",
"userId": "<id:2>",
"name": "Single shot",
"dose": "10mg",
"treatmentClass": "GENERIC",
@@ -178,8 +190,8 @@
"updatedAt": "<updatedAt>"
},
{
"id": "<id:2>",
"userId": "<id:4>",
"id": "<id:3>",
"userId": "<id:2>",
"name": "Twice daily",
"dose": "10mg",
"treatmentClass": "GENERIC",
@@ -213,7 +225,7 @@
},
{
"id": "<id:8>",
"userId": "<id:4>",
"userId": "<id:2>",
"name": "Weekly pen",
"dose": "10mg",
"treatmentClass": "GENERIC",
@@ -272,7 +284,7 @@
},
{
"id": "<id:10>",
"medicationId": "<id:2>",
"medicationId": "<id:3>",
"windowStart": "08:00",
"windowEnd": "10:00",
"label": null,
@@ -332,7 +344,7 @@
},
{
"id": "<id:13>",
"medicationId": "<id:2>",
"medicationId": "<id:3>",
"windowStart": "20:00",
"windowEnd": "22:00",
"label": null,
@@ -357,8 +369,8 @@
"intakes": [
{
"id": "<id:1>",
"userId": "<id:4>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-11T20:00:00.000Z",
"takenAt": "2026-10-11T20:10:00.000Z",
"skipped": false,
@@ -373,7 +385,7 @@
"inventoryConsumption": [
{
"units": 1,
"itemId": "<id:3>"
"itemId": "<id:4>"
}
],
"externalId": null,
@@ -383,8 +395,8 @@
},
{
"id": "<id:14>",
"userId": "<id:4>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-12T08:00:00.000Z",
"takenAt": "2026-10-12T08:15:00.000Z",
"skipped": false,
@@ -399,7 +411,7 @@
"inventoryConsumption": [
{
"units": 1,
"itemId": "<id:3>"
"itemId": "<id:4>"
}
],
"externalId": null,
@@ -409,8 +421,8 @@
},
{
"id": "<id:15>",
"userId": "<id:4>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-12T20:00:00.000Z",
"takenAt": null,
"skipped": true,
@@ -430,8 +442,8 @@
},
{
"id": "<id:16>",
"userId": "<id:4>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-13T08:00:00.000Z",
"takenAt": "2026-10-15T11:30:00.000Z",
"skipped": false,
@@ -446,7 +458,7 @@
"inventoryConsumption": [
{
"units": 1,
"itemId": "<id:3>"
"itemId": "<id:4>"
}
],
"externalId": null,
@@ -456,8 +468,8 @@
},
{
"id": "<id:17>",
"userId": "<id:4>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-13T20:00:00.000Z",
"takenAt": "2026-10-13T20:30:00.000Z",
"skipped": false,
@@ -472,7 +484,7 @@
"inventoryConsumption": [
{
"units": 1,
"itemId": "<id:3>"
"itemId": "<id:4>"
}
],
"externalId": null,
@@ -482,8 +494,8 @@
},
{
"id": "<id:18>",
"userId": "<id:4>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-14T08:00:00.000Z",
"takenAt": "2026-10-14T11:00:00.000Z",
"skipped": false,
@@ -498,7 +510,7 @@
"inventoryConsumption": [
{
"units": 1,
"itemId": "<id:3>"
"itemId": "<id:4>"
}
],
"externalId": null,
@@ -508,8 +520,8 @@
},
{
"id": "<id:19>",
"userId": "<id:4>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-14T20:00:00.000Z",
"takenAt": "2026-10-14T20:05:00.000Z",
"skipped": false,
@@ -529,8 +541,8 @@
},
{
"id": "<id:20>",
"userId": "<id:4>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-15T08:00:00.000Z",
"takenAt": null,
"skipped": true,
@@ -550,7 +562,7 @@
},
{
"id": "<id:21>",
"userId": "<id:4>",
"userId": "<id:2>",
"medicationId": "<id:5>",
"scheduledFor": "2026-10-15T11:00:00.000Z",
"takenAt": null,
@@ -571,8 +583,8 @@
},
{
"id": "<id:22>",
"userId": "<id:4>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-15T20:00:00.000Z",
"takenAt": null,
"skipped": true,
@@ -594,9 +606,9 @@
"doseChanges": [],
"inventoryItems": [
{
"id": "<id:3>",
"userId": "<id:4>",
"medicationId": "<id:2>",
"id": "<id:4>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"state": "IN_USE",
"containerType": "OTHER",
"unitsTotal": "30",
@@ -619,10 +631,10 @@
"audit": [
{
"action": "medication.intake",
"userId": "<id:4>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:2>",
"medicationId": "<id:3>",
"eventId": "<id:20>",
"skipped": false
},
@@ -630,7 +642,7 @@
},
{
"action": "medication.intake",
"userId": "<id:4>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:5>",
@@ -641,10 +653,10 @@
},
{
"action": "medication.intake",
"userId": "<id:4>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:2>",
"medicationId": "<id:3>",
"eventId": "<id:18>",
"skipped": false
},
@@ -652,10 +664,10 @@
},
{
"action": "medication.intake",
"userId": "<id:4>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:2>",
"medicationId": "<id:3>",
"eventId": "<id:16>",
"skipped": false
},
@@ -663,10 +675,10 @@
},
{
"action": "medication.intake",
"userId": "<id:4>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:2>",
"medicationId": "<id:3>",
"eventId": "<id:17>",
"skipped": false
},
@@ -674,10 +686,10 @@
},
{
"action": "medication.intake",
"userId": "<id:4>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:2>",
"medicationId": "<id:3>",
"eventId": "<id:14>",
"skipped": false
},
@@ -685,10 +697,10 @@
},
{
"action": "medication.intake",
"userId": "<id:4>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:2>",
"medicationId": "<id:3>",
"eventId": "<id:1>",
"skipped": false
},
@@ -696,10 +708,10 @@
},
{
"action": "medication.intake",
"userId": "<id:4>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:2>",
"medicationId": "<id:3>",
"eventId": "<id:22>",
"skipped": true
},
@@ -707,10 +719,10 @@
},
{
"action": "medication.intake",
"userId": "<id:4>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:2>",
"medicationId": "<id:3>",
"eventId": "<id:20>",
"skipped": true
},
@@ -718,7 +730,7 @@
},
{
"action": "medication.intake",
"userId": "<id:4>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:5>",
@@ -729,7 +741,7 @@
},
{
"action": "medications.intake.update.refused",
"userId": "<id:4>",
"userId": "<id:2>",
"actorUserId": "<id:23>",
"details": {
"medicationId": "<id:5>",
@@ -740,7 +752,7 @@
],
"idempotency": [
{
"userId": "<id:4>",
"userId": "<id:2>",
"key": "<id:24>",
"method": "POST",
"path": "/api/medications/<daily>/intake",
@@ -3,12 +3,24 @@
"body": {
"data": {
"id": "<id:1>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"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": "<createdAt>"
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
"error": null
},
@@ -21,7 +33,7 @@
"entity_id": "<id:1>"
},
"meta": {
"medication_id": "<id:2>",
"medication_id": "<id:3>",
"skipped": true
},
"warnings": null,
@@ -33,7 +45,7 @@
"effect": "queueMedicationIntakeSync",
"args": [
{
"userId": "<id:3>",
"userId": "<id:2>",
"originDeviceToken": null
}
]
@@ -41,7 +53,7 @@
{
"effect": "countOutstandingDosesToday",
"args": [
"<id:3>",
"<id:2>",
"UTC"
]
},
@@ -49,9 +61,9 @@
"effect": "notifyDelegatedIntake",
"args": [
{
"ownerId": "<id:3>",
"actorId": "<id:3>",
"medicationId": "<id:2>",
"ownerId": "<id:2>",
"actorId": "<id:2>",
"medicationId": "<id:3>",
"status": "skipped"
}
]
@@ -60,8 +72,8 @@
"effect": "dispatchMedicationIntakeWebClear",
"args": [
{
"userId": "<id:3>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-14T20:00:00.000Z",
"badgeCount": 2
}
@@ -72,7 +84,7 @@
"medications": [
{
"id": "<id:4>",
"userId": "<id:3>",
"userId": "<id:2>",
"name": "As needed",
"dose": "10mg",
"treatmentClass": "GENERIC",
@@ -106,7 +118,7 @@
},
{
"id": "<id:5>",
"userId": "<id:3>",
"userId": "<id:2>",
"name": "Record only",
"dose": "10mg",
"treatmentClass": "GENERIC",
@@ -140,7 +152,7 @@
},
{
"id": "<id:6>",
"userId": "<id:3>",
"userId": "<id:2>",
"name": "Single shot",
"dose": "10mg",
"treatmentClass": "GENERIC",
@@ -173,8 +185,8 @@
"updatedAt": "<updatedAt>"
},
{
"id": "<id:2>",
"userId": "<id:3>",
"id": "<id:3>",
"userId": "<id:2>",
"name": "Twice daily",
"dose": "10mg",
"treatmentClass": "GENERIC",
@@ -208,7 +220,7 @@
},
{
"id": "<id:7>",
"userId": "<id:3>",
"userId": "<id:2>",
"name": "Weekly pen",
"dose": "10mg",
"treatmentClass": "GENERIC",
@@ -267,7 +279,7 @@
},
{
"id": "<id:9>",
"medicationId": "<id:2>",
"medicationId": "<id:3>",
"windowStart": "08:00",
"windowEnd": "10:00",
"label": null,
@@ -327,7 +339,7 @@
},
{
"id": "<id:12>",
"medicationId": "<id:2>",
"medicationId": "<id:3>",
"windowStart": "20:00",
"windowEnd": "22:00",
"label": null,
@@ -352,8 +364,8 @@
"intakes": [
{
"id": "<id:13>",
"userId": "<id:3>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-11T20:00:00.000Z",
"takenAt": "2026-10-11T20:10:00.000Z",
"skipped": false,
@@ -378,8 +390,8 @@
},
{
"id": "<id:15>",
"userId": "<id:3>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-12T08:00:00.000Z",
"takenAt": "2026-10-12T08:15:00.000Z",
"skipped": false,
@@ -404,8 +416,8 @@
},
{
"id": "<id:16>",
"userId": "<id:3>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-12T20:00:00.000Z",
"takenAt": null,
"skipped": true,
@@ -425,8 +437,8 @@
},
{
"id": "<id:17>",
"userId": "<id:3>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-13T08:00:00.000Z",
"takenAt": "2026-10-15T11:30:00.000Z",
"skipped": false,
@@ -451,8 +463,8 @@
},
{
"id": "<id:18>",
"userId": "<id:3>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-13T20:00:00.000Z",
"takenAt": "2026-10-13T20:30:00.000Z",
"skipped": false,
@@ -477,8 +489,8 @@
},
{
"id": "<id:19>",
"userId": "<id:3>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-14T08:00:00.000Z",
"takenAt": "2026-10-14T11:00:00.000Z",
"skipped": false,
@@ -503,8 +515,8 @@
},
{
"id": "<id:1>",
"userId": "<id:3>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-14T20:00:00.000Z",
"takenAt": null,
"skipped": true,
@@ -524,8 +536,8 @@
},
{
"id": "<id:20>",
"userId": "<id:3>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-15T08:00:00.000Z",
"takenAt": null,
"skipped": true,
@@ -545,7 +557,7 @@
},
{
"id": "<id:21>",
"userId": "<id:3>",
"userId": "<id:2>",
"medicationId": "<id:4>",
"scheduledFor": "2026-10-15T11:00:00.000Z",
"takenAt": null,
@@ -566,8 +578,8 @@
},
{
"id": "<id:22>",
"userId": "<id:3>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-15T20:00:00.000Z",
"takenAt": null,
"skipped": true,
@@ -590,8 +602,8 @@
"inventoryItems": [
{
"id": "<id:14>",
"userId": "<id:3>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"state": "IN_USE",
"containerType": "OTHER",
"unitsTotal": "30",
@@ -614,10 +626,10 @@
"audit": [
{
"action": "medication.intake",
"userId": "<id:3>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:2>",
"medicationId": "<id:3>",
"eventId": "<id:20>",
"skipped": false
},
@@ -625,7 +637,7 @@
},
{
"action": "medication.intake",
"userId": "<id:3>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:4>",
@@ -636,10 +648,10 @@
},
{
"action": "medication.intake",
"userId": "<id:3>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:2>",
"medicationId": "<id:3>",
"eventId": "<id:19>",
"skipped": false
},
@@ -647,10 +659,10 @@
},
{
"action": "medication.intake",
"userId": "<id:3>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:2>",
"medicationId": "<id:3>",
"eventId": "<id:17>",
"skipped": false
},
@@ -658,10 +670,10 @@
},
{
"action": "medication.intake",
"userId": "<id:3>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:2>",
"medicationId": "<id:3>",
"eventId": "<id:18>",
"skipped": false
},
@@ -669,10 +681,10 @@
},
{
"action": "medication.intake",
"userId": "<id:3>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:2>",
"medicationId": "<id:3>",
"eventId": "<id:15>",
"skipped": false
},
@@ -680,10 +692,10 @@
},
{
"action": "medication.intake",
"userId": "<id:3>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:2>",
"medicationId": "<id:3>",
"eventId": "<id:13>",
"skipped": false
},
@@ -691,10 +703,10 @@
},
{
"action": "medication.intake",
"userId": "<id:3>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:2>",
"medicationId": "<id:3>",
"eventId": "<id:22>",
"skipped": true
},
@@ -702,10 +714,10 @@
},
{
"action": "medication.intake",
"userId": "<id:3>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:2>",
"medicationId": "<id:3>",
"eventId": "<id:20>",
"skipped": true
},
@@ -713,7 +725,7 @@
},
{
"action": "medication.intake",
"userId": "<id:3>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:4>",
@@ -724,10 +736,10 @@
},
{
"action": "medication.intake",
"userId": "<id:3>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:2>",
"medicationId": "<id:3>",
"eventId": "<id:1>",
"skipped": true
},
@@ -735,7 +747,7 @@
},
{
"action": "medications.intake.update.refused",
"userId": "<id:3>",
"userId": "<id:2>",
"actorUserId": "<id:23>",
"details": {
"medicationId": "<id:4>",
@@ -745,10 +757,10 @@
},
{
"action": "medications.intake.update.refused",
"userId": "<id:3>",
"userId": "<id:2>",
"actorUserId": "<id:23>",
"details": {
"medicationId": "<id:2>",
"medicationId": "<id:3>",
"reason": "resolved_event"
},
"ipAddress": null
@@ -756,7 +768,7 @@
],
"idempotency": [
{
"userId": "<id:3>",
"userId": "<id:2>",
"key": "<id:24>",
"method": "POST",
"path": "/api/medications/<daily>/intake",
@@ -3,12 +3,24 @@
"body": {
"data": {
"id": "<id:1>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"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": "<createdAt>"
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
"error": null
},
@@ -21,10 +33,10 @@
"entity_id": "<id:1>"
},
"meta": {
"medication_id": "<id:2>",
"medication_id": "<id:3>",
"units": 1,
"item_ids": [
"<id:3>"
"<id:4>"
],
"auto_opened": 0,
"skipped": false
@@ -38,7 +50,7 @@
"effect": "queueMedicationIntakeSync",
"args": [
{
"userId": "<id:4>",
"userId": "<id:2>",
"originDeviceToken": null
}
]
@@ -46,7 +58,7 @@
{
"effect": "countOutstandingDosesToday",
"args": [
"<id:4>",
"<id:2>",
"UTC"
]
},
@@ -54,9 +66,9 @@
"effect": "notifyDelegatedIntake",
"args": [
{
"ownerId": "<id:4>",
"ownerId": "<id:2>",
"actorId": "<id:5>",
"medicationId": "<id:2>",
"medicationId": "<id:3>",
"status": "taken"
}
]
@@ -65,8 +77,8 @@
"effect": "dispatchMedicationIntakeWebClear",
"args": [
{
"userId": "<id:4>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-11T08:00:00.000Z",
"badgeCount": 2
}
@@ -77,7 +89,7 @@
"medications": [
{
"id": "<id:6>",
"userId": "<id:4>",
"userId": "<id:2>",
"name": "As needed",
"dose": "10mg",
"treatmentClass": "GENERIC",
@@ -111,7 +123,7 @@
},
{
"id": "<id:7>",
"userId": "<id:4>",
"userId": "<id:2>",
"name": "Record only",
"dose": "10mg",
"treatmentClass": "GENERIC",
@@ -145,7 +157,7 @@
},
{
"id": "<id:8>",
"userId": "<id:4>",
"userId": "<id:2>",
"name": "Single shot",
"dose": "10mg",
"treatmentClass": "GENERIC",
@@ -178,8 +190,8 @@
"updatedAt": "<updatedAt>"
},
{
"id": "<id:2>",
"userId": "<id:4>",
"id": "<id:3>",
"userId": "<id:2>",
"name": "Twice daily",
"dose": "10mg",
"treatmentClass": "GENERIC",
@@ -213,7 +225,7 @@
},
{
"id": "<id:9>",
"userId": "<id:4>",
"userId": "<id:2>",
"name": "Weekly pen",
"dose": "10mg",
"treatmentClass": "GENERIC",
@@ -272,7 +284,7 @@
},
{
"id": "<id:11>",
"medicationId": "<id:2>",
"medicationId": "<id:3>",
"windowStart": "08:00",
"windowEnd": "10:00",
"label": null,
@@ -332,7 +344,7 @@
},
{
"id": "<id:14>",
"medicationId": "<id:2>",
"medicationId": "<id:3>",
"windowStart": "20:00",
"windowEnd": "22:00",
"label": null,
@@ -357,8 +369,8 @@
"intakes": [
{
"id": "<id:1>",
"userId": "<id:4>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-11T08:00:00.000Z",
"takenAt": "2026-10-11T08:20:00.000Z",
"skipped": false,
@@ -373,7 +385,7 @@
"inventoryConsumption": [
{
"units": 1,
"itemId": "<id:3>"
"itemId": "<id:4>"
}
],
"externalId": null,
@@ -383,8 +395,8 @@
},
{
"id": "<id:15>",
"userId": "<id:4>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-11T20:00:00.000Z",
"takenAt": "2026-10-11T20:10:00.000Z",
"skipped": false,
@@ -399,7 +411,7 @@
"inventoryConsumption": [
{
"units": 1,
"itemId": "<id:3>"
"itemId": "<id:4>"
}
],
"externalId": null,
@@ -409,8 +421,8 @@
},
{
"id": "<id:16>",
"userId": "<id:4>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-12T08:00:00.000Z",
"takenAt": "2026-10-12T08:15:00.000Z",
"skipped": false,
@@ -425,7 +437,7 @@
"inventoryConsumption": [
{
"units": 1,
"itemId": "<id:3>"
"itemId": "<id:4>"
}
],
"externalId": null,
@@ -435,8 +447,8 @@
},
{
"id": "<id:17>",
"userId": "<id:4>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-12T20:00:00.000Z",
"takenAt": null,
"skipped": true,
@@ -456,8 +468,8 @@
},
{
"id": "<id:18>",
"userId": "<id:4>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-13T08:00:00.000Z",
"takenAt": "2026-10-15T11:30:00.000Z",
"skipped": false,
@@ -472,7 +484,7 @@
"inventoryConsumption": [
{
"units": 1,
"itemId": "<id:3>"
"itemId": "<id:4>"
}
],
"externalId": null,
@@ -482,8 +494,8 @@
},
{
"id": "<id:19>",
"userId": "<id:4>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-13T20:00:00.000Z",
"takenAt": "2026-10-13T20:30:00.000Z",
"skipped": false,
@@ -498,7 +510,7 @@
"inventoryConsumption": [
{
"units": 1,
"itemId": "<id:3>"
"itemId": "<id:4>"
}
],
"externalId": null,
@@ -508,8 +520,8 @@
},
{
"id": "<id:20>",
"userId": "<id:4>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-14T08:00:00.000Z",
"takenAt": "2026-10-14T11:00:00.000Z",
"skipped": false,
@@ -524,7 +536,7 @@
"inventoryConsumption": [
{
"units": 1,
"itemId": "<id:3>"
"itemId": "<id:4>"
}
],
"externalId": null,
@@ -534,8 +546,8 @@
},
{
"id": "<id:21>",
"userId": "<id:4>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-14T20:00:00.000Z",
"takenAt": null,
"skipped": true,
@@ -555,8 +567,8 @@
},
{
"id": "<id:22>",
"userId": "<id:4>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-15T08:00:00.000Z",
"takenAt": null,
"skipped": true,
@@ -576,7 +588,7 @@
},
{
"id": "<id:23>",
"userId": "<id:4>",
"userId": "<id:2>",
"medicationId": "<id:6>",
"scheduledFor": "2026-10-15T11:00:00.000Z",
"takenAt": null,
@@ -597,8 +609,8 @@
},
{
"id": "<id:24>",
"userId": "<id:4>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-15T20:00:00.000Z",
"takenAt": null,
"skipped": true,
@@ -620,9 +632,9 @@
"doseChanges": [],
"inventoryItems": [
{
"id": "<id:3>",
"userId": "<id:4>",
"medicationId": "<id:2>",
"id": "<id:4>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"state": "IN_USE",
"containerType": "OTHER",
"unitsTotal": "30",
@@ -645,10 +657,10 @@
"audit": [
{
"action": "medication.intake",
"userId": "<id:4>",
"userId": "<id:2>",
"actorUserId": "<id:5>",
"details": {
"medicationId": "<id:2>",
"medicationId": "<id:3>",
"eventId": "<id:1>",
"skipped": false
},
@@ -656,10 +668,10 @@
},
{
"action": "medication.intake",
"userId": "<id:4>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:2>",
"medicationId": "<id:3>",
"eventId": "<id:22>",
"skipped": false
},
@@ -667,7 +679,7 @@
},
{
"action": "medication.intake",
"userId": "<id:4>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:6>",
@@ -678,10 +690,10 @@
},
{
"action": "medication.intake",
"userId": "<id:4>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:2>",
"medicationId": "<id:3>",
"eventId": "<id:20>",
"skipped": false
},
@@ -689,10 +701,10 @@
},
{
"action": "medication.intake",
"userId": "<id:4>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:2>",
"medicationId": "<id:3>",
"eventId": "<id:18>",
"skipped": false
},
@@ -700,10 +712,10 @@
},
{
"action": "medication.intake",
"userId": "<id:4>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:2>",
"medicationId": "<id:3>",
"eventId": "<id:19>",
"skipped": false
},
@@ -711,10 +723,10 @@
},
{
"action": "medication.intake",
"userId": "<id:4>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:2>",
"medicationId": "<id:3>",
"eventId": "<id:16>",
"skipped": false
},
@@ -722,10 +734,10 @@
},
{
"action": "medication.intake",
"userId": "<id:4>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:2>",
"medicationId": "<id:3>",
"eventId": "<id:15>",
"skipped": false
},
@@ -733,10 +745,10 @@
},
{
"action": "medication.intake",
"userId": "<id:4>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:2>",
"medicationId": "<id:3>",
"eventId": "<id:24>",
"skipped": true
},
@@ -744,10 +756,10 @@
},
{
"action": "medication.intake",
"userId": "<id:4>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:2>",
"medicationId": "<id:3>",
"eventId": "<id:22>",
"skipped": true
},
@@ -755,7 +767,7 @@
},
{
"action": "medication.intake",
"userId": "<id:4>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:6>",
@@ -766,10 +778,10 @@
},
{
"action": "medication.intake",
"userId": "<id:4>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:2>",
"medicationId": "<id:3>",
"eventId": "<id:21>",
"skipped": true
},
@@ -777,7 +789,7 @@
},
{
"action": "medications.intake.update.refused",
"userId": "<id:4>",
"userId": "<id:2>",
"actorUserId": "<id:5>",
"details": {
"medicationId": "<id:6>",
@@ -787,10 +799,10 @@
},
{
"action": "medications.intake.update.refused",
"userId": "<id:4>",
"userId": "<id:2>",
"actorUserId": "<id:5>",
"details": {
"medicationId": "<id:2>",
"medicationId": "<id:3>",
"reason": "resolved_event"
},
"ipAddress": null
@@ -798,7 +810,7 @@
],
"idempotency": [
{
"userId": "<id:4>",
"userId": "<id:2>",
"key": "<id:25>",
"method": "POST",
"path": "/api/medications/<daily>/intake",
@@ -3,12 +3,24 @@
"body": {
"data": {
"id": "<id:1>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"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": "<createdAt>"
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": "ABDOMEN_LEFT",
"doseTaken": "0.5 pen",
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
"error": null
},
@@ -21,7 +33,7 @@
"entity_id": "<id:1>"
},
"meta": {
"medication_id": "<id:2>",
"medication_id": "<id:3>",
"units": 0,
"item_ids": [],
"auto_opened": 0,
@@ -36,7 +48,7 @@
"effect": "queueMedicationIntakeSync",
"args": [
{
"userId": "<id:3>",
"userId": "<id:2>",
"originDeviceToken": null
}
]
@@ -44,7 +56,7 @@
{
"effect": "countOutstandingDosesToday",
"args": [
"<id:3>",
"<id:2>",
"UTC"
]
},
@@ -52,9 +64,9 @@
"effect": "notifyDelegatedIntake",
"args": [
{
"ownerId": "<id:3>",
"actorId": "<id:3>",
"medicationId": "<id:2>",
"ownerId": "<id:2>",
"actorId": "<id:2>",
"medicationId": "<id:3>",
"status": "taken"
}
]
@@ -63,8 +75,8 @@
"effect": "dispatchMedicationIntakeWebClear",
"args": [
{
"userId": "<id:3>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-15T09:00:00.000Z",
"badgeCount": 2
}
@@ -75,7 +87,7 @@
"medications": [
{
"id": "<id:4>",
"userId": "<id:3>",
"userId": "<id:2>",
"name": "As needed",
"dose": "10mg",
"treatmentClass": "GENERIC",
@@ -109,7 +121,7 @@
},
{
"id": "<id:5>",
"userId": "<id:3>",
"userId": "<id:2>",
"name": "Record only",
"dose": "10mg",
"treatmentClass": "GENERIC",
@@ -143,7 +155,7 @@
},
{
"id": "<id:6>",
"userId": "<id:3>",
"userId": "<id:2>",
"name": "Single shot",
"dose": "10mg",
"treatmentClass": "GENERIC",
@@ -177,7 +189,7 @@
},
{
"id": "<id:7>",
"userId": "<id:3>",
"userId": "<id:2>",
"name": "Twice daily",
"dose": "10mg",
"treatmentClass": "GENERIC",
@@ -210,8 +222,8 @@
"updatedAt": "<updatedAt>"
},
{
"id": "<id:2>",
"userId": "<id:3>",
"id": "<id:3>",
"userId": "<id:2>",
"name": "Weekly pen",
"dose": "10mg",
"treatmentClass": "GENERIC",
@@ -290,7 +302,7 @@
},
{
"id": "<id:10>",
"medicationId": "<id:2>",
"medicationId": "<id:3>",
"windowStart": "09:00",
"windowEnd": "11:00",
"label": null,
@@ -355,7 +367,7 @@
"intakes": [
{
"id": "<id:13>",
"userId": "<id:3>",
"userId": "<id:2>",
"medicationId": "<id:7>",
"scheduledFor": "2026-10-11T08:00:00.000Z",
"takenAt": "2026-10-11T08:20:00.000Z",
@@ -381,7 +393,7 @@
},
{
"id": "<id:15>",
"userId": "<id:3>",
"userId": "<id:2>",
"medicationId": "<id:7>",
"scheduledFor": "2026-10-11T20:00:00.000Z",
"takenAt": "2026-10-11T20:10:00.000Z",
@@ -407,7 +419,7 @@
},
{
"id": "<id:16>",
"userId": "<id:3>",
"userId": "<id:2>",
"medicationId": "<id:7>",
"scheduledFor": "2026-10-12T08:00:00.000Z",
"takenAt": "2026-10-12T08:15:00.000Z",
@@ -433,7 +445,7 @@
},
{
"id": "<id:17>",
"userId": "<id:3>",
"userId": "<id:2>",
"medicationId": "<id:7>",
"scheduledFor": "2026-10-12T20:00:00.000Z",
"takenAt": null,
@@ -454,7 +466,7 @@
},
{
"id": "<id:18>",
"userId": "<id:3>",
"userId": "<id:2>",
"medicationId": "<id:7>",
"scheduledFor": "2026-10-13T08:00:00.000Z",
"takenAt": "2026-10-15T11:30:00.000Z",
@@ -480,7 +492,7 @@
},
{
"id": "<id:19>",
"userId": "<id:3>",
"userId": "<id:2>",
"medicationId": "<id:7>",
"scheduledFor": "2026-10-13T20:00:00.000Z",
"takenAt": "2026-10-13T20:30:00.000Z",
@@ -506,7 +518,7 @@
},
{
"id": "<id:20>",
"userId": "<id:3>",
"userId": "<id:2>",
"medicationId": "<id:7>",
"scheduledFor": "2026-10-14T08:00:00.000Z",
"takenAt": "2026-10-14T11:00:00.000Z",
@@ -532,7 +544,7 @@
},
{
"id": "<id:21>",
"userId": "<id:3>",
"userId": "<id:2>",
"medicationId": "<id:7>",
"scheduledFor": "2026-10-14T20:00:00.000Z",
"takenAt": null,
@@ -553,7 +565,7 @@
},
{
"id": "<id:22>",
"userId": "<id:3>",
"userId": "<id:2>",
"medicationId": "<id:7>",
"scheduledFor": "2026-10-15T08:00:00.000Z",
"takenAt": null,
@@ -574,8 +586,8 @@
},
{
"id": "<id:1>",
"userId": "<id:3>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-15T09:00:00.000Z",
"takenAt": "2026-10-15T09:10:00.000Z",
"skipped": false,
@@ -595,7 +607,7 @@
},
{
"id": "<id:23>",
"userId": "<id:3>",
"userId": "<id:2>",
"medicationId": "<id:4>",
"scheduledFor": "2026-10-15T11:00:00.000Z",
"takenAt": null,
@@ -616,7 +628,7 @@
},
{
"id": "<id:24>",
"userId": "<id:3>",
"userId": "<id:2>",
"medicationId": "<id:7>",
"scheduledFor": "2026-10-15T20:00:00.000Z",
"takenAt": null,
@@ -640,7 +652,7 @@
"inventoryItems": [
{
"id": "<id:14>",
"userId": "<id:3>",
"userId": "<id:2>",
"medicationId": "<id:7>",
"state": "IN_USE",
"containerType": "OTHER",
@@ -664,7 +676,7 @@
"audit": [
{
"action": "medication.intake",
"userId": "<id:3>",
"userId": "<id:2>",
"actorUserId": "<id:25>",
"details": {
"medicationId": "<id:7>",
@@ -675,7 +687,7 @@
},
{
"action": "medication.intake",
"userId": "<id:3>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:7>",
@@ -686,7 +698,7 @@
},
{
"action": "medication.intake",
"userId": "<id:3>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:4>",
@@ -697,7 +709,7 @@
},
{
"action": "medication.intake",
"userId": "<id:3>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:7>",
@@ -708,7 +720,7 @@
},
{
"action": "medication.intake",
"userId": "<id:3>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:7>",
@@ -719,7 +731,7 @@
},
{
"action": "medication.intake",
"userId": "<id:3>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:7>",
@@ -730,7 +742,7 @@
},
{
"action": "medication.intake",
"userId": "<id:3>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:7>",
@@ -741,7 +753,7 @@
},
{
"action": "medication.intake",
"userId": "<id:3>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:7>",
@@ -752,10 +764,10 @@
},
{
"action": "medication.intake",
"userId": "<id:3>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:2>",
"medicationId": "<id:3>",
"eventId": "<id:1>",
"skipped": false
},
@@ -763,7 +775,7 @@
},
{
"action": "medication.intake",
"userId": "<id:3>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:7>",
@@ -774,7 +786,7 @@
},
{
"action": "medication.intake",
"userId": "<id:3>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:7>",
@@ -785,7 +797,7 @@
},
{
"action": "medication.intake",
"userId": "<id:3>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:4>",
@@ -796,7 +808,7 @@
},
{
"action": "medication.intake",
"userId": "<id:3>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:7>",
@@ -807,7 +819,7 @@
},
{
"action": "medications.intake.update.refused",
"userId": "<id:3>",
"userId": "<id:2>",
"actorUserId": "<id:25>",
"details": {
"medicationId": "<id:4>",
@@ -817,7 +829,7 @@
},
{
"action": "medications.intake.update.refused",
"userId": "<id:3>",
"userId": "<id:2>",
"actorUserId": "<id:25>",
"details": {
"medicationId": "<id:7>",
@@ -828,7 +840,7 @@
],
"idempotency": [
{
"userId": "<id:3>",
"userId": "<id:2>",
"key": "<id:26>",
"method": "POST",
"path": "/api/medications/<daily>/intake",
@@ -3,12 +3,24 @@
"body": {
"data": {
"id": "<id:1>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"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": "<createdAt>"
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
"error": null
},
@@ -19,7 +31,7 @@
"name": "medication.oneShot.reconciled"
},
"meta": {
"medication_id": "<id:2>",
"medication_id": "<id:3>",
"units": 0,
"item_ids": [],
"auto_opened": 0,
@@ -35,7 +47,7 @@
"effect": "queueMedicationIntakeSync",
"args": [
{
"userId": "<id:3>",
"userId": "<id:2>",
"originDeviceToken": null
}
]
@@ -43,7 +55,7 @@
{
"effect": "countOutstandingDosesToday",
"args": [
"<id:3>",
"<id:2>",
"UTC"
]
},
@@ -51,9 +63,9 @@
"effect": "notifyDelegatedIntake",
"args": [
{
"ownerId": "<id:3>",
"actorId": "<id:3>",
"medicationId": "<id:2>",
"ownerId": "<id:2>",
"actorId": "<id:2>",
"medicationId": "<id:3>",
"status": "taken"
}
]
@@ -62,8 +74,8 @@
"effect": "dispatchMedicationIntakeWebClear",
"args": [
{
"userId": "<id:3>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-15T09:00:00.000Z",
"badgeCount": 2
}
@@ -74,7 +86,7 @@
"medications": [
{
"id": "<id:4>",
"userId": "<id:3>",
"userId": "<id:2>",
"name": "As needed",
"dose": "10mg",
"treatmentClass": "GENERIC",
@@ -108,7 +120,7 @@
},
{
"id": "<id:5>",
"userId": "<id:3>",
"userId": "<id:2>",
"name": "Record only",
"dose": "10mg",
"treatmentClass": "GENERIC",
@@ -141,8 +153,8 @@
"updatedAt": "<updatedAt>"
},
{
"id": "<id:2>",
"userId": "<id:3>",
"id": "<id:3>",
"userId": "<id:2>",
"name": "Single shot",
"dose": "10mg",
"treatmentClass": "GENERIC",
@@ -176,7 +188,7 @@
},
{
"id": "<id:6>",
"userId": "<id:3>",
"userId": "<id:2>",
"name": "Twice daily",
"dose": "10mg",
"treatmentClass": "GENERIC",
@@ -210,7 +222,7 @@
},
{
"id": "<id:7>",
"userId": "<id:3>",
"userId": "<id:2>",
"name": "Weekly pen",
"dose": "10mg",
"treatmentClass": "GENERIC",
@@ -309,7 +321,7 @@
},
{
"id": "<id:11>",
"medicationId": "<id:2>",
"medicationId": "<id:3>",
"windowStart": "09:00",
"windowEnd": "11:00",
"label": null,
@@ -354,7 +366,7 @@
"intakes": [
{
"id": "<id:13>",
"userId": "<id:3>",
"userId": "<id:2>",
"medicationId": "<id:6>",
"scheduledFor": "2026-10-11T08:00:00.000Z",
"takenAt": "2026-10-11T08:20:00.000Z",
@@ -380,7 +392,7 @@
},
{
"id": "<id:15>",
"userId": "<id:3>",
"userId": "<id:2>",
"medicationId": "<id:6>",
"scheduledFor": "2026-10-11T20:00:00.000Z",
"takenAt": "2026-10-11T20:10:00.000Z",
@@ -406,7 +418,7 @@
},
{
"id": "<id:16>",
"userId": "<id:3>",
"userId": "<id:2>",
"medicationId": "<id:6>",
"scheduledFor": "2026-10-12T08:00:00.000Z",
"takenAt": "2026-10-12T08:15:00.000Z",
@@ -432,7 +444,7 @@
},
{
"id": "<id:17>",
"userId": "<id:3>",
"userId": "<id:2>",
"medicationId": "<id:6>",
"scheduledFor": "2026-10-12T20:00:00.000Z",
"takenAt": null,
@@ -453,7 +465,7 @@
},
{
"id": "<id:18>",
"userId": "<id:3>",
"userId": "<id:2>",
"medicationId": "<id:6>",
"scheduledFor": "2026-10-13T08:00:00.000Z",
"takenAt": "2026-10-15T11:30:00.000Z",
@@ -479,7 +491,7 @@
},
{
"id": "<id:19>",
"userId": "<id:3>",
"userId": "<id:2>",
"medicationId": "<id:6>",
"scheduledFor": "2026-10-13T20:00:00.000Z",
"takenAt": "2026-10-13T20:30:00.000Z",
@@ -505,7 +517,7 @@
},
{
"id": "<id:20>",
"userId": "<id:3>",
"userId": "<id:2>",
"medicationId": "<id:6>",
"scheduledFor": "2026-10-14T08:00:00.000Z",
"takenAt": "2026-10-14T11:00:00.000Z",
@@ -531,7 +543,7 @@
},
{
"id": "<id:21>",
"userId": "<id:3>",
"userId": "<id:2>",
"medicationId": "<id:6>",
"scheduledFor": "2026-10-14T20:00:00.000Z",
"takenAt": null,
@@ -552,7 +564,7 @@
},
{
"id": "<id:22>",
"userId": "<id:3>",
"userId": "<id:2>",
"medicationId": "<id:6>",
"scheduledFor": "2026-10-15T08:00:00.000Z",
"takenAt": null,
@@ -573,7 +585,7 @@
},
{
"id": "<id:23>",
"userId": "<id:3>",
"userId": "<id:2>",
"medicationId": "<id:7>",
"scheduledFor": "2026-10-15T09:00:00.000Z",
"takenAt": "2026-10-15T09:10:00.000Z",
@@ -594,8 +606,8 @@
},
{
"id": "<id:1>",
"userId": "<id:3>",
"medicationId": "<id:2>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-15T09:00:00.000Z",
"takenAt": "2026-10-15T10:00:00.000Z",
"skipped": false,
@@ -615,7 +627,7 @@
},
{
"id": "<id:24>",
"userId": "<id:3>",
"userId": "<id:2>",
"medicationId": "<id:4>",
"scheduledFor": "2026-10-15T11:00:00.000Z",
"takenAt": null,
@@ -636,7 +648,7 @@
},
{
"id": "<id:25>",
"userId": "<id:3>",
"userId": "<id:2>",
"medicationId": "<id:6>",
"scheduledFor": "2026-10-15T20:00:00.000Z",
"takenAt": null,
@@ -660,7 +672,7 @@
"inventoryItems": [
{
"id": "<id:14>",
"userId": "<id:3>",
"userId": "<id:2>",
"medicationId": "<id:6>",
"state": "IN_USE",
"containerType": "OTHER",
@@ -684,7 +696,7 @@
"audit": [
{
"action": "medication.intake",
"userId": "<id:3>",
"userId": "<id:2>",
"actorUserId": "<id:26>",
"details": {
"medicationId": "<id:6>",
@@ -695,7 +707,7 @@
},
{
"action": "medication.intake",
"userId": "<id:3>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:6>",
@@ -706,7 +718,7 @@
},
{
"action": "medication.intake",
"userId": "<id:3>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:4>",
@@ -717,7 +729,7 @@
},
{
"action": "medication.intake",
"userId": "<id:3>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:6>",
@@ -728,7 +740,7 @@
},
{
"action": "medication.intake",
"userId": "<id:3>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:6>",
@@ -739,7 +751,7 @@
},
{
"action": "medication.intake",
"userId": "<id:3>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:6>",
@@ -750,7 +762,7 @@
},
{
"action": "medication.intake",
"userId": "<id:3>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:6>",
@@ -761,7 +773,7 @@
},
{
"action": "medication.intake",
"userId": "<id:3>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:6>",
@@ -772,7 +784,7 @@
},
{
"action": "medication.intake",
"userId": "<id:3>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:7>",
@@ -783,10 +795,10 @@
},
{
"action": "medication.intake",
"userId": "<id:3>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:2>",
"medicationId": "<id:3>",
"eventId": "<id:1>",
"skipped": false
},
@@ -794,7 +806,7 @@
},
{
"action": "medication.intake",
"userId": "<id:3>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:6>",
@@ -805,7 +817,7 @@
},
{
"action": "medication.intake",
"userId": "<id:3>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:6>",
@@ -816,7 +828,7 @@
},
{
"action": "medication.intake",
"userId": "<id:3>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:4>",
@@ -827,7 +839,7 @@
},
{
"action": "medication.intake",
"userId": "<id:3>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:6>",
@@ -838,17 +850,17 @@
},
{
"action": "medication.oneShot.reconciled",
"userId": "<id:3>",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:2>",
"medicationId": "<id:3>",
"action": "deactivate"
},
"ipAddress": null
},
{
"action": "medications.intake.update.refused",
"userId": "<id:3>",
"userId": "<id:2>",
"actorUserId": "<id:26>",
"details": {
"medicationId": "<id:4>",
@@ -858,7 +870,7 @@
},
{
"action": "medications.intake.update.refused",
"userId": "<id:3>",
"userId": "<id:2>",
"actorUserId": "<id:26>",
"details": {
"medicationId": "<id:6>",
@@ -869,7 +881,7 @@
],
"idempotency": [
{
"userId": "<id:3>",
"userId": "<id:2>",
"key": "<id:27>",
"method": "POST",
"path": "/api/medications/<daily>/intake",
@@ -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
},
@@ -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
},
@@ -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
},
@@ -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
},
@@ -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
},
@@ -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
},
@@ -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
},
@@ -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
},
@@ -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
},
@@ -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
},
@@ -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
},
@@ -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,
@@ -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<string, string>;
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;
});
@@ -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",
@@ -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,
@@ -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,