test(medications): pin the dose correction and undo before they move

This commit is contained in:
Marc-André Bombeck committed 2026-10-23 11:33:51 +02:00
1 parent 3df80389ab
commit 4c9dc2be5b
23 files changed
+11321

No files matched your search

@@ -0,0 +1,408 @@
{
"status": 200,
"body": {
"data": {
"id": "<id:1>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-13T08:00:00.000Z",
"takenAt": "2026-10-13T08:40:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
"error": null
},
"events": [
{
"status": 200,
"action": {
"name": "medication.intake.update",
"entity_type": "intake_event",
"entity_id": "<id:1>"
},
"meta": {
"medication_id": "<id:3>",
"units": 1,
"item_ids": [
"<id:4>"
],
"auto_opened": 1
},
"warnings": null,
"error": null
}
],
"effects": [
{
"effect": "queueMedicationIntakeSync",
"args": [
{
"userId": "<id:2>",
"originDeviceToken": null
}
]
}
],
"stored": {
"medications": [
{
"id": "<id:5>",
"userId": "<id:2>",
"name": "Parity one-shot",
"dose": "10mg",
"treatmentClass": "GENERIC",
"dosesPerUnit": null,
"unitsPerDose": "1",
"active": false,
"notificationsEnabled": true,
"pausedAt": null,
"snoozedUntil": null,
"startsOn": "2026-10-01T00:00:00.000Z",
"endsOn": null,
"oneShot": true,
"asNeeded": false,
"trackIntake": true,
"autoMarkTaken": false,
"autoMarkTakenSince": null,
"deliveryForm": "ORAL",
"trackInjectionSites": false,
"allowedInjectionSites": [],
"liveActivityEnabled": false,
"criticalAlarmEnabled": false,
"atcCode": null,
"rxNormCode": null,
"lowStockNotifiedAt": null,
"lowStockNotifiedThresholdDays": null,
"reorderLeadDays": null,
"externalSource": null,
"externalId": null,
"createdAt": "<createdAt>",
"updatedAt": "<updatedAt>"
},
{
"id": "<id:3>",
"userId": "<id:2>",
"name": "Parity tablet",
"dose": "10mg",
"treatmentClass": "GENERIC",
"dosesPerUnit": null,
"unitsPerDose": "1",
"active": true,
"notificationsEnabled": true,
"pausedAt": null,
"snoozedUntil": null,
"startsOn": "2026-10-01T00:00:00.000Z",
"endsOn": null,
"oneShot": false,
"asNeeded": false,
"trackIntake": true,
"autoMarkTaken": false,
"autoMarkTakenSince": null,
"deliveryForm": "ORAL",
"trackInjectionSites": false,
"allowedInjectionSites": [],
"liveActivityEnabled": false,
"criticalAlarmEnabled": false,
"atcCode": null,
"rxNormCode": null,
"lowStockNotifiedAt": null,
"lowStockNotifiedThresholdDays": null,
"reorderLeadDays": null,
"externalSource": null,
"externalId": null,
"createdAt": "<createdAt>",
"updatedAt": "<updatedAt>"
}
],
"schedules": [
{
"id": "<id:6>",
"medicationId": "<id:3>",
"windowStart": "08:00",
"windowEnd": "10:00",
"label": "Morning",
"dose": null,
"unitsPerDose": null,
"daysOfWeek": null,
"timesOfDay": [],
"reminderGraceMinutes": null,
"rrule": null,
"rollingIntervalDays": null,
"scheduleType": "SCHEDULED",
"cyclicOnWeeks": null,
"cyclicOffWeeks": null,
"doseWindows": null
},
{
"id": "<id:7>",
"medicationId": "<id:5>",
"windowStart": "09:00",
"windowEnd": "11:00",
"label": null,
"dose": null,
"unitsPerDose": null,
"daysOfWeek": null,
"timesOfDay": [],
"reminderGraceMinutes": null,
"rrule": null,
"rollingIntervalDays": null,
"scheduleType": "SCHEDULED",
"cyclicOnWeeks": null,
"cyclicOffWeeks": null,
"doseWindows": null
},
{
"id": "<id:8>",
"medicationId": "<id:3>",
"windowStart": "20:00",
"windowEnd": "22:00",
"label": "Evening",
"dose": null,
"unitsPerDose": null,
"daysOfWeek": null,
"timesOfDay": [],
"reminderGraceMinutes": null,
"rrule": null,
"rollingIntervalDays": null,
"scheduleType": "SCHEDULED",
"cyclicOnWeeks": null,
"cyclicOffWeeks": null,
"doseWindows": null
}
],
"revisions": [],
"pauseEras": [],
"courses": [],
"intakes": [
{
"id": "<id:9>",
"userId": "<id:2>",
"medicationId": "<id:5>",
"scheduledFor": "2026-10-10T09:00:00.000Z",
"takenAt": "2026-10-10T09:30:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:10>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-11T08:00:00.000Z",
"takenAt": "2026-10-11T08:20:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:11>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-11T20:00:00.000Z",
"takenAt": "2026-10-11T20:20:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:12>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-12T08:00:00.000Z",
"takenAt": "2026-10-12T08:05:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "2026-10-12T09:00:00.000Z"
},
{
"id": "<id:1>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-13T08:00:00.000Z",
"takenAt": "2026-10-13T08:40:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": [
{
"units": 1,
"itemId": "<id:4>"
}
],
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:13>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-13T20:00:00.000Z",
"takenAt": "2026-10-13T20:15:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:14>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-14T08:00:00.000Z",
"takenAt": "2026-10-14T08:10:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:15>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-14T20:00:00.000Z",
"takenAt": null,
"skipped": true,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
}
],
"doseChanges": [],
"inventoryItems": [
{
"id": "<id:4>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"state": "IN_USE",
"containerType": "OTHER",
"unitsTotal": "30",
"unitsRemaining": "29",
"firstUseAt": "2026-10-13T08:40:00.000Z",
"expiresAt": null,
"printedExpiry": null,
"purchasedAt": "2026-10-01T06:00:00.000Z",
"manufacturer": null,
"doseStrength": null,
"notes": null,
"notesEncrypted": null,
"createdAt": "<createdAt>",
"updatedAt": "<updatedAt>"
}
],
"inventoryEvents": [],
"categories": [],
"ingredients": [],
"audit": [
{
"action": "medication.intake.update",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"eventId": "<id:1>",
"medicationId": "<id:3>",
"fields": [
"takenAt"
],
"previous": {
"takenAt": null
}
},
"ipAddress": null
}
],
"idempotency": []
}
}
@@ -0,0 +1,423 @@
{
"status": 200,
"body": {
"data": {
"id": "<id:1>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-13T08:00:00.000Z",
"takenAt": "2026-10-13T08:40:00.000Z",
"skipped": true,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": [
{
"units": 1,
"itemId": "<id:4>"
}
],
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
"error": null
},
"events": [
{
"status": 200,
"action": {
"name": "medication.intake.update",
"entity_type": "intake_event",
"entity_id": "<id:1>"
},
"meta": {
"medication_id": "<id:3>",
"units": 1,
"item_ids": [
"<id:4>"
]
},
"warnings": null,
"error": null
}
],
"effects": [
{
"effect": "queueMedicationIntakeSync",
"args": [
{
"userId": "<id:2>",
"originDeviceToken": null
}
]
}
],
"stored": {
"medications": [
{
"id": "<id:5>",
"userId": "<id:2>",
"name": "Parity one-shot",
"dose": "10mg",
"treatmentClass": "GENERIC",
"dosesPerUnit": null,
"unitsPerDose": "1",
"active": false,
"notificationsEnabled": true,
"pausedAt": null,
"snoozedUntil": null,
"startsOn": "2026-10-01T00:00:00.000Z",
"endsOn": null,
"oneShot": true,
"asNeeded": false,
"trackIntake": true,
"autoMarkTaken": false,
"autoMarkTakenSince": null,
"deliveryForm": "ORAL",
"trackInjectionSites": false,
"allowedInjectionSites": [],
"liveActivityEnabled": false,
"criticalAlarmEnabled": false,
"atcCode": null,
"rxNormCode": null,
"lowStockNotifiedAt": null,
"lowStockNotifiedThresholdDays": null,
"reorderLeadDays": null,
"externalSource": null,
"externalId": null,
"createdAt": "<createdAt>",
"updatedAt": "<updatedAt>"
},
{
"id": "<id:3>",
"userId": "<id:2>",
"name": "Parity tablet",
"dose": "10mg",
"treatmentClass": "GENERIC",
"dosesPerUnit": null,
"unitsPerDose": "1",
"active": true,
"notificationsEnabled": true,
"pausedAt": null,
"snoozedUntil": null,
"startsOn": "2026-10-01T00:00:00.000Z",
"endsOn": null,
"oneShot": false,
"asNeeded": false,
"trackIntake": true,
"autoMarkTaken": false,
"autoMarkTakenSince": null,
"deliveryForm": "ORAL",
"trackInjectionSites": false,
"allowedInjectionSites": [],
"liveActivityEnabled": false,
"criticalAlarmEnabled": false,
"atcCode": null,
"rxNormCode": null,
"lowStockNotifiedAt": null,
"lowStockNotifiedThresholdDays": null,
"reorderLeadDays": null,
"externalSource": null,
"externalId": null,
"createdAt": "<createdAt>",
"updatedAt": "<updatedAt>"
}
],
"schedules": [
{
"id": "<id:6>",
"medicationId": "<id:3>",
"windowStart": "08:00",
"windowEnd": "10:00",
"label": "Morning",
"dose": null,
"unitsPerDose": null,
"daysOfWeek": null,
"timesOfDay": [],
"reminderGraceMinutes": null,
"rrule": null,
"rollingIntervalDays": null,
"scheduleType": "SCHEDULED",
"cyclicOnWeeks": null,
"cyclicOffWeeks": null,
"doseWindows": null
},
{
"id": "<id:7>",
"medicationId": "<id:5>",
"windowStart": "09:00",
"windowEnd": "11:00",
"label": null,
"dose": null,
"unitsPerDose": null,
"daysOfWeek": null,
"timesOfDay": [],
"reminderGraceMinutes": null,
"rrule": null,
"rollingIntervalDays": null,
"scheduleType": "SCHEDULED",
"cyclicOnWeeks": null,
"cyclicOffWeeks": null,
"doseWindows": null
},
{
"id": "<id:8>",
"medicationId": "<id:3>",
"windowStart": "20:00",
"windowEnd": "22:00",
"label": "Evening",
"dose": null,
"unitsPerDose": null,
"daysOfWeek": null,
"timesOfDay": [],
"reminderGraceMinutes": null,
"rrule": null,
"rollingIntervalDays": null,
"scheduleType": "SCHEDULED",
"cyclicOnWeeks": null,
"cyclicOffWeeks": null,
"doseWindows": null
}
],
"revisions": [],
"pauseEras": [],
"courses": [],
"intakes": [
{
"id": "<id:9>",
"userId": "<id:2>",
"medicationId": "<id:5>",
"scheduledFor": "2026-10-10T09:00:00.000Z",
"takenAt": "2026-10-10T09:30:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:10>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-11T08:00:00.000Z",
"takenAt": "2026-10-11T08:20:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:11>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-11T20:00:00.000Z",
"takenAt": "2026-10-11T20:20:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:12>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-12T08:00:00.000Z",
"takenAt": "2026-10-12T08:05:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "2026-10-12T09:00:00.000Z"
},
{
"id": "<id:1>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-13T08:00:00.000Z",
"takenAt": "2026-10-13T08:40:00.000Z",
"skipped": true,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:13>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-13T20:00:00.000Z",
"takenAt": "2026-10-13T20:15:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:14>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-14T08:00:00.000Z",
"takenAt": "2026-10-14T08:10:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:15>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-14T20:00:00.000Z",
"takenAt": null,
"skipped": true,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
}
],
"doseChanges": [],
"inventoryItems": [
{
"id": "<id:4>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"state": "IN_USE",
"containerType": "OTHER",
"unitsTotal": "30",
"unitsRemaining": "30",
"firstUseAt": "2026-10-13T08:40:00.000Z",
"expiresAt": null,
"printedExpiry": null,
"purchasedAt": "2026-10-01T06:00:00.000Z",
"manufacturer": null,
"doseStrength": null,
"notes": null,
"notesEncrypted": null,
"createdAt": "<createdAt>",
"updatedAt": "<updatedAt>"
}
],
"inventoryEvents": [],
"categories": [],
"ingredients": [],
"audit": [
{
"action": "medication.intake.update",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"eventId": "<id:1>",
"medicationId": "<id:3>",
"fields": [
"skipped"
],
"previous": {
"skipped": false
}
},
"ipAddress": null
},
{
"action": "medication.intake.update",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"eventId": "<id:1>",
"medicationId": "<id:3>",
"fields": [
"takenAt"
],
"previous": {
"takenAt": null
}
},
"ipAddress": null
}
],
"idempotency": []
}
}
@@ -0,0 +1,420 @@
{
"status": 200,
"body": {
"data": {
"id": "<id:1>",
"takenAt": "2026-10-14T20:30:00.000Z",
"skipped": false,
"idempotencyKey": null,
"scheduledFor": "2026-10-14T20:00:00.000Z",
"source": "WEB",
"createdAt": "<createdAt>"
},
"error": null
},
"events": [
{
"status": 200,
"action": {
"name": "medication.intake.update",
"entity_type": "intake_event",
"entity_id": "<id:2>"
},
"meta": {
"medication_id": "<id:3>"
},
"warnings": null,
"error": null
}
],
"effects": [
{
"effect": "queueMedicationIntakeSync",
"args": [
{
"userId": "<id:4>",
"originDeviceToken": null
}
]
}
],
"stored": {
"medications": [
{
"id": "<id:5>",
"userId": "<id:4>",
"name": "Parity one-shot",
"dose": "10mg",
"treatmentClass": "GENERIC",
"dosesPerUnit": null,
"unitsPerDose": "1",
"active": false,
"notificationsEnabled": true,
"pausedAt": null,
"snoozedUntil": null,
"startsOn": "2026-10-01T00:00:00.000Z",
"endsOn": null,
"oneShot": true,
"asNeeded": false,
"trackIntake": true,
"autoMarkTaken": false,
"autoMarkTakenSince": null,
"deliveryForm": "ORAL",
"trackInjectionSites": false,
"allowedInjectionSites": [],
"liveActivityEnabled": false,
"criticalAlarmEnabled": false,
"atcCode": null,
"rxNormCode": null,
"lowStockNotifiedAt": null,
"lowStockNotifiedThresholdDays": null,
"reorderLeadDays": null,
"externalSource": null,
"externalId": null,
"createdAt": "<createdAt>",
"updatedAt": "<updatedAt>"
},
{
"id": "<id:3>",
"userId": "<id:4>",
"name": "Parity tablet",
"dose": "10mg",
"treatmentClass": "GENERIC",
"dosesPerUnit": null,
"unitsPerDose": "1",
"active": true,
"notificationsEnabled": true,
"pausedAt": null,
"snoozedUntil": null,
"startsOn": "2026-10-01T00:00:00.000Z",
"endsOn": null,
"oneShot": false,
"asNeeded": false,
"trackIntake": true,
"autoMarkTaken": false,
"autoMarkTakenSince": null,
"deliveryForm": "ORAL",
"trackInjectionSites": false,
"allowedInjectionSites": [],
"liveActivityEnabled": false,
"criticalAlarmEnabled": false,
"atcCode": null,
"rxNormCode": null,
"lowStockNotifiedAt": null,
"lowStockNotifiedThresholdDays": null,
"reorderLeadDays": null,
"externalSource": null,
"externalId": null,
"createdAt": "<createdAt>",
"updatedAt": "<updatedAt>"
}
],
"schedules": [
{
"id": "<id:6>",
"medicationId": "<id:3>",
"windowStart": "08:00",
"windowEnd": "10:00",
"label": "Morning",
"dose": null,
"unitsPerDose": null,
"daysOfWeek": null,
"timesOfDay": [],
"reminderGraceMinutes": null,
"rrule": null,
"rollingIntervalDays": null,
"scheduleType": "SCHEDULED",
"cyclicOnWeeks": null,
"cyclicOffWeeks": null,
"doseWindows": null
},
{
"id": "<id:7>",
"medicationId": "<id:5>",
"windowStart": "09:00",
"windowEnd": "11:00",
"label": null,
"dose": null,
"unitsPerDose": null,
"daysOfWeek": null,
"timesOfDay": [],
"reminderGraceMinutes": null,
"rrule": null,
"rollingIntervalDays": null,
"scheduleType": "SCHEDULED",
"cyclicOnWeeks": null,
"cyclicOffWeeks": null,
"doseWindows": null
},
{
"id": "<id:8>",
"medicationId": "<id:3>",
"windowStart": "20:00",
"windowEnd": "22:00",
"label": "Evening",
"dose": null,
"unitsPerDose": null,
"daysOfWeek": null,
"timesOfDay": [],
"reminderGraceMinutes": null,
"rrule": null,
"rollingIntervalDays": null,
"scheduleType": "SCHEDULED",
"cyclicOnWeeks": null,
"cyclicOffWeeks": null,
"doseWindows": null
}
],
"revisions": [],
"pauseEras": [],
"courses": [],
"intakes": [
{
"id": "<id:9>",
"userId": "<id:4>",
"medicationId": "<id:5>",
"scheduledFor": "2026-10-10T09:00:00.000Z",
"takenAt": "2026-10-10T09:30:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:10>",
"userId": "<id:4>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-11T08:00:00.000Z",
"takenAt": "2026-10-11T08:20:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:11>",
"userId": "<id:4>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-11T20:00:00.000Z",
"takenAt": "2026-10-11T20:20:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:12>",
"userId": "<id:4>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-12T08:00:00.000Z",
"takenAt": "2026-10-12T08:05:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "2026-10-12T09:00:00.000Z"
},
{
"id": "<id:13>",
"userId": "<id:4>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-13T08:00:00.000Z",
"takenAt": "2026-10-13T08:40:00.000Z",
"skipped": true,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:14>",
"userId": "<id:4>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-13T20:00:00.000Z",
"takenAt": "2026-10-13T20:15:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:2>",
"userId": "<id:4>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-14T08:00:00.000Z",
"takenAt": "2026-10-14T08:10:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "<now>"
},
{
"id": "<id:1>",
"userId": "<id:4>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-14T20:00:00.000Z",
"takenAt": "2026-10-14T20:30:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
}
],
"doseChanges": [],
"inventoryItems": [
{
"id": "<id:15>",
"userId": "<id:4>",
"medicationId": "<id:3>",
"state": "IN_USE",
"containerType": "OTHER",
"unitsTotal": "30",
"unitsRemaining": "30",
"firstUseAt": "2026-10-13T08:40:00.000Z",
"expiresAt": null,
"printedExpiry": null,
"purchasedAt": "2026-10-01T06:00:00.000Z",
"manufacturer": null,
"doseStrength": null,
"notes": null,
"notesEncrypted": null,
"createdAt": "<createdAt>",
"updatedAt": "<updatedAt>"
}
],
"inventoryEvents": [],
"categories": [],
"ingredients": [],
"audit": [
{
"action": "medication.intake.update",
"userId": "<id:4>",
"actorUserId": null,
"details": {
"eventId": "<id:2>",
"medicationId": "<id:3>",
"fields": [
"scheduledFor",
"takenAt"
],
"previous": {
"scheduledFor": "2026-10-14T08:00:00.000Z",
"takenAt": "2026-10-14T08:10:00.000Z"
}
},
"ipAddress": null
},
{
"action": "medication.intake.update",
"userId": "<id:4>",
"actorUserId": null,
"details": {
"eventId": "<id:13>",
"medicationId": "<id:3>",
"fields": [
"skipped"
],
"previous": {
"skipped": false
}
},
"ipAddress": null
},
{
"action": "medication.intake.update",
"userId": "<id:4>",
"actorUserId": null,
"details": {
"eventId": "<id:13>",
"medicationId": "<id:3>",
"fields": [
"takenAt"
],
"previous": {
"takenAt": null
}
},
"ipAddress": null
}
],
"idempotency": []
}
}
@@ -0,0 +1,457 @@
{
"status": 200,
"body": {
"data": {
"id": "<id:1>",
"takenAt": "2026-10-13T20:15:00.000Z",
"skipped": false,
"idempotencyKey": null,
"scheduledFor": "2026-10-12T20:00:00.000Z",
"source": "WEB",
"createdAt": "<createdAt>"
},
"error": null
},
"events": [
{
"status": 200,
"action": {
"name": "medication.intake.update",
"entity_type": "intake_event",
"entity_id": "<id:2>"
},
"meta": {
"medication_id": "<id:3>"
},
"warnings": null,
"error": null
}
],
"effects": [
{
"effect": "queueMedicationIntakeSync",
"args": [
{
"userId": "<id:4>",
"originDeviceToken": null
}
]
}
],
"stored": {
"medications": [
{
"id": "<id:5>",
"userId": "<id:4>",
"name": "Parity one-shot",
"dose": "10mg",
"treatmentClass": "GENERIC",
"dosesPerUnit": null,
"unitsPerDose": "1",
"active": false,
"notificationsEnabled": true,
"pausedAt": null,
"snoozedUntil": null,
"startsOn": "2026-10-01T00:00:00.000Z",
"endsOn": null,
"oneShot": true,
"asNeeded": false,
"trackIntake": true,
"autoMarkTaken": false,
"autoMarkTakenSince": null,
"deliveryForm": "ORAL",
"trackInjectionSites": false,
"allowedInjectionSites": [],
"liveActivityEnabled": false,
"criticalAlarmEnabled": false,
"atcCode": null,
"rxNormCode": null,
"lowStockNotifiedAt": null,
"lowStockNotifiedThresholdDays": null,
"reorderLeadDays": null,
"externalSource": null,
"externalId": null,
"createdAt": "<createdAt>",
"updatedAt": "<updatedAt>"
},
{
"id": "<id:3>",
"userId": "<id:4>",
"name": "Parity tablet",
"dose": "10mg",
"treatmentClass": "GENERIC",
"dosesPerUnit": null,
"unitsPerDose": "1",
"active": true,
"notificationsEnabled": true,
"pausedAt": null,
"snoozedUntil": null,
"startsOn": "2026-10-01T00:00:00.000Z",
"endsOn": null,
"oneShot": false,
"asNeeded": false,
"trackIntake": true,
"autoMarkTaken": false,
"autoMarkTakenSince": null,
"deliveryForm": "ORAL",
"trackInjectionSites": false,
"allowedInjectionSites": [],
"liveActivityEnabled": false,
"criticalAlarmEnabled": false,
"atcCode": null,
"rxNormCode": null,
"lowStockNotifiedAt": null,
"lowStockNotifiedThresholdDays": null,
"reorderLeadDays": null,
"externalSource": null,
"externalId": null,
"createdAt": "<createdAt>",
"updatedAt": "<updatedAt>"
}
],
"schedules": [
{
"id": "<id:6>",
"medicationId": "<id:3>",
"windowStart": "08:00",
"windowEnd": "10:00",
"label": "Morning",
"dose": null,
"unitsPerDose": null,
"daysOfWeek": null,
"timesOfDay": [],
"reminderGraceMinutes": null,
"rrule": null,
"rollingIntervalDays": null,
"scheduleType": "SCHEDULED",
"cyclicOnWeeks": null,
"cyclicOffWeeks": null,
"doseWindows": null
},
{
"id": "<id:7>",
"medicationId": "<id:5>",
"windowStart": "09:00",
"windowEnd": "11:00",
"label": null,
"dose": null,
"unitsPerDose": null,
"daysOfWeek": null,
"timesOfDay": [],
"reminderGraceMinutes": null,
"rrule": null,
"rollingIntervalDays": null,
"scheduleType": "SCHEDULED",
"cyclicOnWeeks": null,
"cyclicOffWeeks": null,
"doseWindows": null
},
{
"id": "<id:8>",
"medicationId": "<id:3>",
"windowStart": "20:00",
"windowEnd": "22:00",
"label": "Evening",
"dose": null,
"unitsPerDose": null,
"daysOfWeek": null,
"timesOfDay": [],
"reminderGraceMinutes": null,
"rrule": null,
"rollingIntervalDays": null,
"scheduleType": "SCHEDULED",
"cyclicOnWeeks": null,
"cyclicOffWeeks": null,
"doseWindows": null
}
],
"revisions": [],
"pauseEras": [],
"courses": [],
"intakes": [
{
"id": "<id:9>",
"userId": "<id:4>",
"medicationId": "<id:5>",
"scheduledFor": "2026-10-10T09:00:00.000Z",
"takenAt": "2026-10-10T09:30:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:10>",
"userId": "<id:4>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-11T08:00:00.000Z",
"takenAt": "2026-10-11T08:20:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:11>",
"userId": "<id:4>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-11T20:00:00.000Z",
"takenAt": "2026-10-11T20:20:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:12>",
"userId": "<id:4>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-12T08:00:00.000Z",
"takenAt": "2026-10-12T08:05:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "2026-10-12T09:00:00.000Z"
},
{
"id": "<id:1>",
"userId": "<id:4>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-12T20:00:00.000Z",
"takenAt": "2026-10-13T20:15:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "USER_PIN",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:13>",
"userId": "<id:4>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-13T08:00:00.000Z",
"takenAt": "2026-10-13T08:40:00.000Z",
"skipped": true,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:2>",
"userId": "<id:4>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-13T20:00:00.000Z",
"takenAt": "2026-10-13T20:15:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "<now>"
},
{
"id": "<id:14>",
"userId": "<id:4>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-14T08:00:00.000Z",
"takenAt": "2026-10-14T08:10:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "<now>"
},
{
"id": "<id:15>",
"userId": "<id:4>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-14T20:00:00.000Z",
"takenAt": "2026-10-14T20:30:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
}
],
"doseChanges": [],
"inventoryItems": [
{
"id": "<id:16>",
"userId": "<id:4>",
"medicationId": "<id:3>",
"state": "IN_USE",
"containerType": "OTHER",
"unitsTotal": "30",
"unitsRemaining": "30",
"firstUseAt": "2026-10-13T08:40:00.000Z",
"expiresAt": null,
"printedExpiry": null,
"purchasedAt": "2026-10-01T06:00:00.000Z",
"manufacturer": null,
"doseStrength": null,
"notes": null,
"notesEncrypted": null,
"createdAt": "<createdAt>",
"updatedAt": "<updatedAt>"
}
],
"inventoryEvents": [],
"categories": [],
"ingredients": [],
"audit": [
{
"action": "medication.intake.update",
"userId": "<id:4>",
"actorUserId": null,
"details": {
"eventId": "<id:14>",
"medicationId": "<id:3>",
"fields": [
"scheduledFor",
"takenAt"
],
"previous": {
"scheduledFor": "2026-10-14T08:00:00.000Z",
"takenAt": "2026-10-14T08:10:00.000Z"
}
},
"ipAddress": null
},
{
"action": "medication.intake.update",
"userId": "<id:4>",
"actorUserId": null,
"details": {
"eventId": "<id:2>",
"medicationId": "<id:3>",
"fields": [
"scheduledFor"
],
"previous": {
"scheduledFor": "2026-10-13T20:00:00.000Z"
}
},
"ipAddress": null
},
{
"action": "medication.intake.update",
"userId": "<id:4>",
"actorUserId": null,
"details": {
"eventId": "<id:13>",
"medicationId": "<id:3>",
"fields": [
"skipped"
],
"previous": {
"skipped": false
}
},
"ipAddress": null
},
{
"action": "medication.intake.update",
"userId": "<id:4>",
"actorUserId": null,
"details": {
"eventId": "<id:13>",
"medicationId": "<id:3>",
"fields": [
"takenAt"
],
"previous": {
"takenAt": null
}
},
"ipAddress": null
}
],
"idempotency": []
}
}
@@ -0,0 +1,442 @@
{
"status": 422,
"body": {
"data": null,
"error": "forceSlotInstant is not a scheduled slot of this medication",
"meta": {
"errorCode": "medications.intake.force_slot.invalid",
"requestId": "<requestId>"
}
},
"events": [
{
"status": 422,
"action": {
"name": "medication.intake.force_slot.invalid"
},
"meta": {
"medication_id": "<id:1>",
"event_id": "<id:2>"
},
"warnings": null,
"error": null
}
],
"effects": [],
"stored": {
"medications": [
{
"id": "<id:3>",
"userId": "<id:4>",
"name": "Parity one-shot",
"dose": "10mg",
"treatmentClass": "GENERIC",
"dosesPerUnit": null,
"unitsPerDose": "1",
"active": false,
"notificationsEnabled": true,
"pausedAt": null,
"snoozedUntil": null,
"startsOn": "2026-10-01T00:00:00.000Z",
"endsOn": null,
"oneShot": true,
"asNeeded": false,
"trackIntake": true,
"autoMarkTaken": false,
"autoMarkTakenSince": null,
"deliveryForm": "ORAL",
"trackInjectionSites": false,
"allowedInjectionSites": [],
"liveActivityEnabled": false,
"criticalAlarmEnabled": false,
"atcCode": null,
"rxNormCode": null,
"lowStockNotifiedAt": null,
"lowStockNotifiedThresholdDays": null,
"reorderLeadDays": null,
"externalSource": null,
"externalId": null,
"createdAt": "<createdAt>",
"updatedAt": "<updatedAt>"
},
{
"id": "<id:1>",
"userId": "<id:4>",
"name": "Parity tablet",
"dose": "10mg",
"treatmentClass": "GENERIC",
"dosesPerUnit": null,
"unitsPerDose": "1",
"active": true,
"notificationsEnabled": true,
"pausedAt": null,
"snoozedUntil": null,
"startsOn": "2026-10-01T00:00:00.000Z",
"endsOn": null,
"oneShot": false,
"asNeeded": false,
"trackIntake": true,
"autoMarkTaken": false,
"autoMarkTakenSince": null,
"deliveryForm": "ORAL",
"trackInjectionSites": false,
"allowedInjectionSites": [],
"liveActivityEnabled": false,
"criticalAlarmEnabled": false,
"atcCode": null,
"rxNormCode": null,
"lowStockNotifiedAt": null,
"lowStockNotifiedThresholdDays": null,
"reorderLeadDays": null,
"externalSource": null,
"externalId": null,
"createdAt": "<createdAt>",
"updatedAt": "<updatedAt>"
}
],
"schedules": [
{
"id": "<id:5>",
"medicationId": "<id:1>",
"windowStart": "08:00",
"windowEnd": "10:00",
"label": "Morning",
"dose": null,
"unitsPerDose": null,
"daysOfWeek": null,
"timesOfDay": [],
"reminderGraceMinutes": null,
"rrule": null,
"rollingIntervalDays": null,
"scheduleType": "SCHEDULED",
"cyclicOnWeeks": null,
"cyclicOffWeeks": null,
"doseWindows": null
},
{
"id": "<id:6>",
"medicationId": "<id:3>",
"windowStart": "09:00",
"windowEnd": "11:00",
"label": null,
"dose": null,
"unitsPerDose": null,
"daysOfWeek": null,
"timesOfDay": [],
"reminderGraceMinutes": null,
"rrule": null,
"rollingIntervalDays": null,
"scheduleType": "SCHEDULED",
"cyclicOnWeeks": null,
"cyclicOffWeeks": null,
"doseWindows": null
},
{
"id": "<id:7>",
"medicationId": "<id:1>",
"windowStart": "20:00",
"windowEnd": "22:00",
"label": "Evening",
"dose": null,
"unitsPerDose": null,
"daysOfWeek": null,
"timesOfDay": [],
"reminderGraceMinutes": null,
"rrule": null,
"rollingIntervalDays": null,
"scheduleType": "SCHEDULED",
"cyclicOnWeeks": null,
"cyclicOffWeeks": null,
"doseWindows": null
}
],
"revisions": [],
"pauseEras": [],
"courses": [],
"intakes": [
{
"id": "<id:8>",
"userId": "<id:4>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-10T09:00:00.000Z",
"takenAt": "2026-10-10T09:30:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:9>",
"userId": "<id:4>",
"medicationId": "<id:1>",
"scheduledFor": "2026-10-11T08:00:00.000Z",
"takenAt": "2026-10-11T08:20:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:10>",
"userId": "<id:4>",
"medicationId": "<id:1>",
"scheduledFor": "2026-10-11T20:00:00.000Z",
"takenAt": "2026-10-11T20:20:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:11>",
"userId": "<id:4>",
"medicationId": "<id:1>",
"scheduledFor": "2026-10-12T08:00:00.000Z",
"takenAt": "2026-10-12T08:05:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "2026-10-12T09:00:00.000Z"
},
{
"id": "<id:12>",
"userId": "<id:4>",
"medicationId": "<id:1>",
"scheduledFor": "2026-10-12T20:00:00.000Z",
"takenAt": "2026-10-13T20:15:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "USER_PIN",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:13>",
"userId": "<id:4>",
"medicationId": "<id:1>",
"scheduledFor": "2026-10-13T08:00:00.000Z",
"takenAt": "2026-10-13T08:40:00.000Z",
"skipped": true,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:14>",
"userId": "<id:4>",
"medicationId": "<id:1>",
"scheduledFor": "2026-10-13T20:00:00.000Z",
"takenAt": "2026-10-13T20:15:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "<now>"
},
{
"id": "<id:15>",
"userId": "<id:4>",
"medicationId": "<id:1>",
"scheduledFor": "2026-10-14T08:00:00.000Z",
"takenAt": "2026-10-14T08:10:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "<now>"
},
{
"id": "<id:2>",
"userId": "<id:4>",
"medicationId": "<id:1>",
"scheduledFor": "2026-10-14T20:00:00.000Z",
"takenAt": "2026-10-14T20:30:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
}
],
"doseChanges": [],
"inventoryItems": [
{
"id": "<id:16>",
"userId": "<id:4>",
"medicationId": "<id:1>",
"state": "IN_USE",
"containerType": "OTHER",
"unitsTotal": "30",
"unitsRemaining": "30",
"firstUseAt": "2026-10-13T08:40:00.000Z",
"expiresAt": null,
"printedExpiry": null,
"purchasedAt": "2026-10-01T06:00:00.000Z",
"manufacturer": null,
"doseStrength": null,
"notes": null,
"notesEncrypted": null,
"createdAt": "<createdAt>",
"updatedAt": "<updatedAt>"
}
],
"inventoryEvents": [],
"categories": [],
"ingredients": [],
"audit": [
{
"action": "medication.intake.update",
"userId": "<id:4>",
"actorUserId": null,
"details": {
"eventId": "<id:15>",
"medicationId": "<id:1>",
"fields": [
"scheduledFor",
"takenAt"
],
"previous": {
"scheduledFor": "2026-10-14T08:00:00.000Z",
"takenAt": "2026-10-14T08:10:00.000Z"
}
},
"ipAddress": null
},
{
"action": "medication.intake.update",
"userId": "<id:4>",
"actorUserId": null,
"details": {
"eventId": "<id:14>",
"medicationId": "<id:1>",
"fields": [
"scheduledFor"
],
"previous": {
"scheduledFor": "2026-10-13T20:00:00.000Z"
}
},
"ipAddress": null
},
{
"action": "medication.intake.update",
"userId": "<id:4>",
"actorUserId": null,
"details": {
"eventId": "<id:13>",
"medicationId": "<id:1>",
"fields": [
"skipped"
],
"previous": {
"skipped": false
}
},
"ipAddress": null
},
{
"action": "medication.intake.update",
"userId": "<id:4>",
"actorUserId": null,
"details": {
"eventId": "<id:13>",
"medicationId": "<id:1>",
"fields": [
"takenAt"
],
"previous": {
"takenAt": null
}
},
"ipAddress": null
}
],
"idempotency": []
}
}
@@ -0,0 +1,442 @@
{
"status": 422,
"body": {
"data": null,
"error": "forceSlotInstant already carries a recorded dose action",
"meta": {
"errorCode": "medications.intake.force_slot.occupied",
"requestId": "<requestId>"
}
},
"events": [
{
"status": 422,
"action": {
"name": "medication.intake.force_slot.occupied"
},
"meta": {
"medication_id": "<id:1>",
"event_id": "<id:2>"
},
"warnings": null,
"error": null
}
],
"effects": [],
"stored": {
"medications": [
{
"id": "<id:3>",
"userId": "<id:4>",
"name": "Parity one-shot",
"dose": "10mg",
"treatmentClass": "GENERIC",
"dosesPerUnit": null,
"unitsPerDose": "1",
"active": false,
"notificationsEnabled": true,
"pausedAt": null,
"snoozedUntil": null,
"startsOn": "2026-10-01T00:00:00.000Z",
"endsOn": null,
"oneShot": true,
"asNeeded": false,
"trackIntake": true,
"autoMarkTaken": false,
"autoMarkTakenSince": null,
"deliveryForm": "ORAL",
"trackInjectionSites": false,
"allowedInjectionSites": [],
"liveActivityEnabled": false,
"criticalAlarmEnabled": false,
"atcCode": null,
"rxNormCode": null,
"lowStockNotifiedAt": null,
"lowStockNotifiedThresholdDays": null,
"reorderLeadDays": null,
"externalSource": null,
"externalId": null,
"createdAt": "<createdAt>",
"updatedAt": "<updatedAt>"
},
{
"id": "<id:1>",
"userId": "<id:4>",
"name": "Parity tablet",
"dose": "10mg",
"treatmentClass": "GENERIC",
"dosesPerUnit": null,
"unitsPerDose": "1",
"active": true,
"notificationsEnabled": true,
"pausedAt": null,
"snoozedUntil": null,
"startsOn": "2026-10-01T00:00:00.000Z",
"endsOn": null,
"oneShot": false,
"asNeeded": false,
"trackIntake": true,
"autoMarkTaken": false,
"autoMarkTakenSince": null,
"deliveryForm": "ORAL",
"trackInjectionSites": false,
"allowedInjectionSites": [],
"liveActivityEnabled": false,
"criticalAlarmEnabled": false,
"atcCode": null,
"rxNormCode": null,
"lowStockNotifiedAt": null,
"lowStockNotifiedThresholdDays": null,
"reorderLeadDays": null,
"externalSource": null,
"externalId": null,
"createdAt": "<createdAt>",
"updatedAt": "<updatedAt>"
}
],
"schedules": [
{
"id": "<id:5>",
"medicationId": "<id:1>",
"windowStart": "08:00",
"windowEnd": "10:00",
"label": "Morning",
"dose": null,
"unitsPerDose": null,
"daysOfWeek": null,
"timesOfDay": [],
"reminderGraceMinutes": null,
"rrule": null,
"rollingIntervalDays": null,
"scheduleType": "SCHEDULED",
"cyclicOnWeeks": null,
"cyclicOffWeeks": null,
"doseWindows": null
},
{
"id": "<id:6>",
"medicationId": "<id:3>",
"windowStart": "09:00",
"windowEnd": "11:00",
"label": null,
"dose": null,
"unitsPerDose": null,
"daysOfWeek": null,
"timesOfDay": [],
"reminderGraceMinutes": null,
"rrule": null,
"rollingIntervalDays": null,
"scheduleType": "SCHEDULED",
"cyclicOnWeeks": null,
"cyclicOffWeeks": null,
"doseWindows": null
},
{
"id": "<id:7>",
"medicationId": "<id:1>",
"windowStart": "20:00",
"windowEnd": "22:00",
"label": "Evening",
"dose": null,
"unitsPerDose": null,
"daysOfWeek": null,
"timesOfDay": [],
"reminderGraceMinutes": null,
"rrule": null,
"rollingIntervalDays": null,
"scheduleType": "SCHEDULED",
"cyclicOnWeeks": null,
"cyclicOffWeeks": null,
"doseWindows": null
}
],
"revisions": [],
"pauseEras": [],
"courses": [],
"intakes": [
{
"id": "<id:8>",
"userId": "<id:4>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-10T09:00:00.000Z",
"takenAt": "2026-10-10T09:30:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:9>",
"userId": "<id:4>",
"medicationId": "<id:1>",
"scheduledFor": "2026-10-11T08:00:00.000Z",
"takenAt": "2026-10-11T08:20:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:10>",
"userId": "<id:4>",
"medicationId": "<id:1>",
"scheduledFor": "2026-10-11T20:00:00.000Z",
"takenAt": "2026-10-11T20:20:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:11>",
"userId": "<id:4>",
"medicationId": "<id:1>",
"scheduledFor": "2026-10-12T08:00:00.000Z",
"takenAt": "2026-10-12T08:05:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "2026-10-12T09:00:00.000Z"
},
{
"id": "<id:12>",
"userId": "<id:4>",
"medicationId": "<id:1>",
"scheduledFor": "2026-10-12T20:00:00.000Z",
"takenAt": "2026-10-13T20:15:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "USER_PIN",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:13>",
"userId": "<id:4>",
"medicationId": "<id:1>",
"scheduledFor": "2026-10-13T08:00:00.000Z",
"takenAt": "2026-10-13T08:40:00.000Z",
"skipped": true,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:14>",
"userId": "<id:4>",
"medicationId": "<id:1>",
"scheduledFor": "2026-10-13T20:00:00.000Z",
"takenAt": "2026-10-13T20:15:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "<now>"
},
{
"id": "<id:15>",
"userId": "<id:4>",
"medicationId": "<id:1>",
"scheduledFor": "2026-10-14T08:00:00.000Z",
"takenAt": "2026-10-14T08:10:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "<now>"
},
{
"id": "<id:2>",
"userId": "<id:4>",
"medicationId": "<id:1>",
"scheduledFor": "2026-10-14T20:00:00.000Z",
"takenAt": "2026-10-14T20:30:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
}
],
"doseChanges": [],
"inventoryItems": [
{
"id": "<id:16>",
"userId": "<id:4>",
"medicationId": "<id:1>",
"state": "IN_USE",
"containerType": "OTHER",
"unitsTotal": "30",
"unitsRemaining": "30",
"firstUseAt": "2026-10-13T08:40:00.000Z",
"expiresAt": null,
"printedExpiry": null,
"purchasedAt": "2026-10-01T06:00:00.000Z",
"manufacturer": null,
"doseStrength": null,
"notes": null,
"notesEncrypted": null,
"createdAt": "<createdAt>",
"updatedAt": "<updatedAt>"
}
],
"inventoryEvents": [],
"categories": [],
"ingredients": [],
"audit": [
{
"action": "medication.intake.update",
"userId": "<id:4>",
"actorUserId": null,
"details": {
"eventId": "<id:15>",
"medicationId": "<id:1>",
"fields": [
"scheduledFor",
"takenAt"
],
"previous": {
"scheduledFor": "2026-10-14T08:00:00.000Z",
"takenAt": "2026-10-14T08:10:00.000Z"
}
},
"ipAddress": null
},
{
"action": "medication.intake.update",
"userId": "<id:4>",
"actorUserId": null,
"details": {
"eventId": "<id:14>",
"medicationId": "<id:1>",
"fields": [
"scheduledFor"
],
"previous": {
"scheduledFor": "2026-10-13T20:00:00.000Z"
}
},
"ipAddress": null
},
{
"action": "medication.intake.update",
"userId": "<id:4>",
"actorUserId": null,
"details": {
"eventId": "<id:13>",
"medicationId": "<id:1>",
"fields": [
"skipped"
],
"previous": {
"skipped": false
}
},
"ipAddress": null
},
{
"action": "medication.intake.update",
"userId": "<id:4>",
"actorUserId": null,
"details": {
"eventId": "<id:13>",
"medicationId": "<id:1>",
"fields": [
"takenAt"
],
"previous": {
"takenAt": null
}
},
"ipAddress": null
}
],
"idempotency": []
}
}
@@ -0,0 +1,494 @@
{
"status": 200,
"body": {
"data": {
"id": "<id:1>",
"takenAt": "2026-10-13T20:15:00.000Z",
"skipped": false,
"idempotencyKey": null,
"scheduledFor": "2026-10-13T20:00:00.000Z",
"source": "WEB",
"createdAt": "<createdAt>"
},
"error": null
},
"events": [
{
"status": 200,
"action": {
"name": "medication.intake.update",
"entity_type": "intake_event",
"entity_id": "<id:2>"
},
"meta": {
"medication_id": "<id:3>"
},
"warnings": null,
"error": null
}
],
"effects": [
{
"effect": "queueMedicationIntakeSync",
"args": [
{
"userId": "<id:4>",
"originDeviceToken": null
}
]
}
],
"stored": {
"medications": [
{
"id": "<id:5>",
"userId": "<id:4>",
"name": "Parity one-shot",
"dose": "10mg",
"treatmentClass": "GENERIC",
"dosesPerUnit": null,
"unitsPerDose": "1",
"active": false,
"notificationsEnabled": true,
"pausedAt": null,
"snoozedUntil": null,
"startsOn": "2026-10-01T00:00:00.000Z",
"endsOn": null,
"oneShot": true,
"asNeeded": false,
"trackIntake": true,
"autoMarkTaken": false,
"autoMarkTakenSince": null,
"deliveryForm": "ORAL",
"trackInjectionSites": false,
"allowedInjectionSites": [],
"liveActivityEnabled": false,
"criticalAlarmEnabled": false,
"atcCode": null,
"rxNormCode": null,
"lowStockNotifiedAt": null,
"lowStockNotifiedThresholdDays": null,
"reorderLeadDays": null,
"externalSource": null,
"externalId": null,
"createdAt": "<createdAt>",
"updatedAt": "<updatedAt>"
},
{
"id": "<id:3>",
"userId": "<id:4>",
"name": "Parity tablet",
"dose": "10mg",
"treatmentClass": "GENERIC",
"dosesPerUnit": null,
"unitsPerDose": "1",
"active": true,
"notificationsEnabled": true,
"pausedAt": null,
"snoozedUntil": null,
"startsOn": "2026-10-01T00:00:00.000Z",
"endsOn": null,
"oneShot": false,
"asNeeded": false,
"trackIntake": true,
"autoMarkTaken": false,
"autoMarkTakenSince": null,
"deliveryForm": "ORAL",
"trackInjectionSites": false,
"allowedInjectionSites": [],
"liveActivityEnabled": false,
"criticalAlarmEnabled": false,
"atcCode": null,
"rxNormCode": null,
"lowStockNotifiedAt": null,
"lowStockNotifiedThresholdDays": null,
"reorderLeadDays": null,
"externalSource": null,
"externalId": null,
"createdAt": "<createdAt>",
"updatedAt": "<updatedAt>"
}
],
"schedules": [
{
"id": "<id:6>",
"medicationId": "<id:3>",
"windowStart": "08:00",
"windowEnd": "10:00",
"label": "Morning",
"dose": null,
"unitsPerDose": null,
"daysOfWeek": null,
"timesOfDay": [],
"reminderGraceMinutes": null,
"rrule": null,
"rollingIntervalDays": null,
"scheduleType": "SCHEDULED",
"cyclicOnWeeks": null,
"cyclicOffWeeks": null,
"doseWindows": null
},
{
"id": "<id:7>",
"medicationId": "<id:5>",
"windowStart": "09:00",
"windowEnd": "11:00",
"label": null,
"dose": null,
"unitsPerDose": null,
"daysOfWeek": null,
"timesOfDay": [],
"reminderGraceMinutes": null,
"rrule": null,
"rollingIntervalDays": null,
"scheduleType": "SCHEDULED",
"cyclicOnWeeks": null,
"cyclicOffWeeks": null,
"doseWindows": null
},
{
"id": "<id:8>",
"medicationId": "<id:3>",
"windowStart": "20:00",
"windowEnd": "22:00",
"label": "Evening",
"dose": null,
"unitsPerDose": null,
"daysOfWeek": null,
"timesOfDay": [],
"reminderGraceMinutes": null,
"rrule": null,
"rollingIntervalDays": null,
"scheduleType": "SCHEDULED",
"cyclicOnWeeks": null,
"cyclicOffWeeks": null,
"doseWindows": null
}
],
"revisions": [],
"pauseEras": [],
"courses": [],
"intakes": [
{
"id": "<id:9>",
"userId": "<id:4>",
"medicationId": "<id:5>",
"scheduledFor": "2026-10-10T09:00:00.000Z",
"takenAt": "2026-10-10T09:30:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:10>",
"userId": "<id:4>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-11T08:00:00.000Z",
"takenAt": "2026-10-11T08:20:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:11>",
"userId": "<id:4>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-11T20:00:00.000Z",
"takenAt": "2026-10-11T20:20:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:12>",
"userId": "<id:4>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-12T08:00:00.000Z",
"takenAt": "2026-10-12T08:05:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "2026-10-12T09:00:00.000Z"
},
{
"id": "<id:2>",
"userId": "<id:4>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-12T20:00:00.000Z",
"takenAt": "2026-10-13T20:15:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "USER_PIN",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "<now>"
},
{
"id": "<id:13>",
"userId": "<id:4>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-13T08:00:00.000Z",
"takenAt": "2026-10-13T08:40:00.000Z",
"skipped": true,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:14>",
"userId": "<id:4>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-13T20:00:00.000Z",
"takenAt": "2026-10-13T20:15:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "<now>"
},
{
"id": "<id:1>",
"userId": "<id:4>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-13T20:00:00.000Z",
"takenAt": "2026-10-13T20:15:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "USER_PIN",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:15>",
"userId": "<id:4>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-14T08:00:00.000Z",
"takenAt": "2026-10-14T08:10:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "<now>"
},
{
"id": "<id:16>",
"userId": "<id:4>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-14T20:00:00.000Z",
"takenAt": "2026-10-14T20:30:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
}
],
"doseChanges": [],
"inventoryItems": [
{
"id": "<id:17>",
"userId": "<id:4>",
"medicationId": "<id:3>",
"state": "IN_USE",
"containerType": "OTHER",
"unitsTotal": "30",
"unitsRemaining": "30",
"firstUseAt": "2026-10-13T08:40:00.000Z",
"expiresAt": null,
"printedExpiry": null,
"purchasedAt": "2026-10-01T06:00:00.000Z",
"manufacturer": null,
"doseStrength": null,
"notes": null,
"notesEncrypted": null,
"createdAt": "<createdAt>",
"updatedAt": "<updatedAt>"
}
],
"inventoryEvents": [],
"categories": [],
"ingredients": [],
"audit": [
{
"action": "medication.intake.update",
"userId": "<id:4>",
"actorUserId": null,
"details": {
"eventId": "<id:15>",
"medicationId": "<id:3>",
"fields": [
"scheduledFor",
"takenAt"
],
"previous": {
"scheduledFor": "2026-10-14T08:00:00.000Z",
"takenAt": "2026-10-14T08:10:00.000Z"
}
},
"ipAddress": null
},
{
"action": "medication.intake.update",
"userId": "<id:4>",
"actorUserId": null,
"details": {
"eventId": "<id:2>",
"medicationId": "<id:3>",
"fields": [
"scheduledFor"
],
"previous": {
"scheduledFor": "2026-10-12T20:00:00.000Z"
}
},
"ipAddress": null
},
{
"action": "medication.intake.update",
"userId": "<id:4>",
"actorUserId": null,
"details": {
"eventId": "<id:14>",
"medicationId": "<id:3>",
"fields": [
"scheduledFor"
],
"previous": {
"scheduledFor": "2026-10-13T20:00:00.000Z"
}
},
"ipAddress": null
},
{
"action": "medication.intake.update",
"userId": "<id:4>",
"actorUserId": null,
"details": {
"eventId": "<id:13>",
"medicationId": "<id:3>",
"fields": [
"skipped"
],
"previous": {
"skipped": false
}
},
"ipAddress": null
},
{
"action": "medication.intake.update",
"userId": "<id:4>",
"actorUserId": null,
"details": {
"eventId": "<id:13>",
"medicationId": "<id:3>",
"fields": [
"takenAt"
],
"previous": {
"takenAt": null
}
},
"ipAddress": null
}
],
"idempotency": []
}
}
@@ -0,0 +1,533 @@
{
"status": 200,
"body": {
"data": {
"id": "<id:1>",
"takenAt": "2026-10-14T08:45:00.000Z",
"skipped": false,
"idempotencyKey": null,
"scheduledFor": "2026-10-14T08:00:00.000Z",
"source": "WEB",
"createdAt": "<createdAt>"
},
"error": null
},
"events": [
{
"status": 200,
"action": {
"name": "medication.intake.update",
"entity_type": "intake_event",
"entity_id": "<id:2>"
},
"meta": {
"medication_id": "<id:3>"
},
"warnings": null,
"error": null
}
],
"effects": [
{
"effect": "queueMedicationIntakeSync",
"args": [
{
"userId": "<id:4>",
"originDeviceToken": null
}
]
}
],
"stored": {
"medications": [
{
"id": "<id:5>",
"userId": "<id:4>",
"name": "Parity one-shot",
"dose": "10mg",
"treatmentClass": "GENERIC",
"dosesPerUnit": null,
"unitsPerDose": "1",
"active": false,
"notificationsEnabled": true,
"pausedAt": null,
"snoozedUntil": null,
"startsOn": "2026-10-01T00:00:00.000Z",
"endsOn": null,
"oneShot": true,
"asNeeded": false,
"trackIntake": true,
"autoMarkTaken": false,
"autoMarkTakenSince": null,
"deliveryForm": "ORAL",
"trackInjectionSites": false,
"allowedInjectionSites": [],
"liveActivityEnabled": false,
"criticalAlarmEnabled": false,
"atcCode": null,
"rxNormCode": null,
"lowStockNotifiedAt": null,
"lowStockNotifiedThresholdDays": null,
"reorderLeadDays": null,
"externalSource": null,
"externalId": null,
"createdAt": "<createdAt>",
"updatedAt": "<updatedAt>"
},
{
"id": "<id:3>",
"userId": "<id:4>",
"name": "Parity tablet",
"dose": "10mg",
"treatmentClass": "GENERIC",
"dosesPerUnit": null,
"unitsPerDose": "1",
"active": true,
"notificationsEnabled": true,
"pausedAt": null,
"snoozedUntil": null,
"startsOn": "2026-10-01T00:00:00.000Z",
"endsOn": null,
"oneShot": false,
"asNeeded": false,
"trackIntake": true,
"autoMarkTaken": false,
"autoMarkTakenSince": null,
"deliveryForm": "ORAL",
"trackInjectionSites": false,
"allowedInjectionSites": [],
"liveActivityEnabled": false,
"criticalAlarmEnabled": false,
"atcCode": null,
"rxNormCode": null,
"lowStockNotifiedAt": null,
"lowStockNotifiedThresholdDays": null,
"reorderLeadDays": null,
"externalSource": null,
"externalId": null,
"createdAt": "<createdAt>",
"updatedAt": "<updatedAt>"
}
],
"schedules": [
{
"id": "<id:6>",
"medicationId": "<id:3>",
"windowStart": "08:00",
"windowEnd": "10:00",
"label": "Morning",
"dose": null,
"unitsPerDose": null,
"daysOfWeek": null,
"timesOfDay": [],
"reminderGraceMinutes": null,
"rrule": null,
"rollingIntervalDays": null,
"scheduleType": "SCHEDULED",
"cyclicOnWeeks": null,
"cyclicOffWeeks": null,
"doseWindows": null
},
{
"id": "<id:7>",
"medicationId": "<id:5>",
"windowStart": "09:00",
"windowEnd": "11:00",
"label": null,
"dose": null,
"unitsPerDose": null,
"daysOfWeek": null,
"timesOfDay": [],
"reminderGraceMinutes": null,
"rrule": null,
"rollingIntervalDays": null,
"scheduleType": "SCHEDULED",
"cyclicOnWeeks": null,
"cyclicOffWeeks": null,
"doseWindows": null
},
{
"id": "<id:8>",
"medicationId": "<id:3>",
"windowStart": "20:00",
"windowEnd": "22:00",
"label": "Evening",
"dose": null,
"unitsPerDose": null,
"daysOfWeek": null,
"timesOfDay": [],
"reminderGraceMinutes": null,
"rrule": null,
"rollingIntervalDays": null,
"scheduleType": "SCHEDULED",
"cyclicOnWeeks": null,
"cyclicOffWeeks": null,
"doseWindows": null
}
],
"revisions": [],
"pauseEras": [],
"courses": [],
"intakes": [
{
"id": "<id:9>",
"userId": "<id:4>",
"medicationId": "<id:5>",
"scheduledFor": "2026-10-10T09:00:00.000Z",
"takenAt": "2026-10-10T09:30:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:10>",
"userId": "<id:4>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-11T08:00:00.000Z",
"takenAt": "2026-10-11T08:20:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:11>",
"userId": "<id:4>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-11T20:00:00.000Z",
"takenAt": "2026-10-11T20:20:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:12>",
"userId": "<id:4>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-12T08:00:00.000Z",
"takenAt": "2026-10-12T08:05:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "2026-10-12T09:00:00.000Z"
},
{
"id": "<id:13>",
"userId": "<id:4>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-12T20:00:00.000Z",
"takenAt": "2026-10-13T20:15:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "USER_PIN",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "<now>"
},
{
"id": "<id:14>",
"userId": "<id:4>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-13T08:00:00.000Z",
"takenAt": "2026-10-13T08:40:00.000Z",
"skipped": true,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:15>",
"userId": "<id:4>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-13T20:00:00.000Z",
"takenAt": "2026-10-13T20:15:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "<now>"
},
{
"id": "<id:16>",
"userId": "<id:4>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-13T20:00:00.000Z",
"takenAt": "2026-10-13T20:15:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "USER_PIN",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:17>",
"userId": "<id:4>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-14T08:00:00.000Z",
"takenAt": "2026-10-14T08:10:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "<now>"
},
{
"id": "<id:1>",
"userId": "<id:4>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-14T08:00:00.000Z",
"takenAt": "2026-10-14T08:45:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:2>",
"userId": "<id:4>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-14T20:00:00.000Z",
"takenAt": "2026-10-14T20:30:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "<now>"
}
],
"doseChanges": [],
"inventoryItems": [
{
"id": "<id:18>",
"userId": "<id:4>",
"medicationId": "<id:3>",
"state": "IN_USE",
"containerType": "OTHER",
"unitsTotal": "30",
"unitsRemaining": "30",
"firstUseAt": "2026-10-13T08:40:00.000Z",
"expiresAt": null,
"printedExpiry": null,
"purchasedAt": "2026-10-01T06:00:00.000Z",
"manufacturer": null,
"doseStrength": null,
"notes": null,
"notesEncrypted": null,
"createdAt": "<createdAt>",
"updatedAt": "<updatedAt>"
}
],
"inventoryEvents": [],
"categories": [],
"ingredients": [],
"audit": [
{
"action": "medication.intake.update",
"userId": "<id:4>",
"actorUserId": null,
"details": {
"eventId": "<id:17>",
"medicationId": "<id:3>",
"fields": [
"scheduledFor",
"takenAt"
],
"previous": {
"scheduledFor": "2026-10-14T08:00:00.000Z",
"takenAt": "2026-10-14T08:10:00.000Z"
}
},
"ipAddress": null
},
{
"action": "medication.intake.update",
"userId": "<id:4>",
"actorUserId": null,
"details": {
"eventId": "<id:2>",
"medicationId": "<id:3>",
"fields": [
"scheduledFor",
"takenAt"
],
"previous": {
"scheduledFor": "2026-10-14T20:00:00.000Z",
"takenAt": "2026-10-14T20:30:00.000Z"
}
},
"ipAddress": null
},
{
"action": "medication.intake.update",
"userId": "<id:4>",
"actorUserId": null,
"details": {
"eventId": "<id:13>",
"medicationId": "<id:3>",
"fields": [
"scheduledFor"
],
"previous": {
"scheduledFor": "2026-10-12T20:00:00.000Z"
}
},
"ipAddress": null
},
{
"action": "medication.intake.update",
"userId": "<id:4>",
"actorUserId": null,
"details": {
"eventId": "<id:15>",
"medicationId": "<id:3>",
"fields": [
"scheduledFor"
],
"previous": {
"scheduledFor": "2026-10-13T20:00:00.000Z"
}
},
"ipAddress": null
},
{
"action": "medication.intake.update",
"userId": "<id:4>",
"actorUserId": null,
"details": {
"eventId": "<id:14>",
"medicationId": "<id:3>",
"fields": [
"skipped"
],
"previous": {
"skipped": false
}
},
"ipAddress": null
},
{
"action": "medication.intake.update",
"userId": "<id:4>",
"actorUserId": null,
"details": {
"eventId": "<id:14>",
"medicationId": "<id:3>",
"fields": [
"takenAt"
],
"previous": {
"takenAt": null
}
},
"ipAddress": null
}
],
"idempotency": []
}
}
@@ -0,0 +1,518 @@
{
"status": 422,
"body": {
"data": null,
"error": "takenAt is before the medication's start date",
"meta": {
"errorCode": "medications.intake.taken_at.before_start",
"requestId": "<requestId>"
}
},
"events": [
{
"status": 422,
"action": {
"name": "medications.intake.event.update.before-start-date"
},
"meta": {
"medication_id": "<id:1>",
"event_id": "<id:2>"
},
"warnings": null,
"error": null
}
],
"effects": [],
"stored": {
"medications": [
{
"id": "<id:3>",
"userId": "<id:4>",
"name": "Parity one-shot",
"dose": "10mg",
"treatmentClass": "GENERIC",
"dosesPerUnit": null,
"unitsPerDose": "1",
"active": false,
"notificationsEnabled": true,
"pausedAt": null,
"snoozedUntil": null,
"startsOn": "2026-10-01T00:00:00.000Z",
"endsOn": null,
"oneShot": true,
"asNeeded": false,
"trackIntake": true,
"autoMarkTaken": false,
"autoMarkTakenSince": null,
"deliveryForm": "ORAL",
"trackInjectionSites": false,
"allowedInjectionSites": [],
"liveActivityEnabled": false,
"criticalAlarmEnabled": false,
"atcCode": null,
"rxNormCode": null,
"lowStockNotifiedAt": null,
"lowStockNotifiedThresholdDays": null,
"reorderLeadDays": null,
"externalSource": null,
"externalId": null,
"createdAt": "<createdAt>",
"updatedAt": "<updatedAt>"
},
{
"id": "<id:1>",
"userId": "<id:4>",
"name": "Parity tablet",
"dose": "10mg",
"treatmentClass": "GENERIC",
"dosesPerUnit": null,
"unitsPerDose": "1",
"active": true,
"notificationsEnabled": true,
"pausedAt": null,
"snoozedUntil": null,
"startsOn": "2026-10-01T00:00:00.000Z",
"endsOn": null,
"oneShot": false,
"asNeeded": false,
"trackIntake": true,
"autoMarkTaken": false,
"autoMarkTakenSince": null,
"deliveryForm": "ORAL",
"trackInjectionSites": false,
"allowedInjectionSites": [],
"liveActivityEnabled": false,
"criticalAlarmEnabled": false,
"atcCode": null,
"rxNormCode": null,
"lowStockNotifiedAt": null,
"lowStockNotifiedThresholdDays": null,
"reorderLeadDays": null,
"externalSource": null,
"externalId": null,
"createdAt": "<createdAt>",
"updatedAt": "<updatedAt>"
}
],
"schedules": [
{
"id": "<id:5>",
"medicationId": "<id:1>",
"windowStart": "08:00",
"windowEnd": "10:00",
"label": "Morning",
"dose": null,
"unitsPerDose": null,
"daysOfWeek": null,
"timesOfDay": [],
"reminderGraceMinutes": null,
"rrule": null,
"rollingIntervalDays": null,
"scheduleType": "SCHEDULED",
"cyclicOnWeeks": null,
"cyclicOffWeeks": null,
"doseWindows": null
},
{
"id": "<id:6>",
"medicationId": "<id:3>",
"windowStart": "09:00",
"windowEnd": "11:00",
"label": null,
"dose": null,
"unitsPerDose": null,
"daysOfWeek": null,
"timesOfDay": [],
"reminderGraceMinutes": null,
"rrule": null,
"rollingIntervalDays": null,
"scheduleType": "SCHEDULED",
"cyclicOnWeeks": null,
"cyclicOffWeeks": null,
"doseWindows": null
},
{
"id": "<id:7>",
"medicationId": "<id:1>",
"windowStart": "20:00",
"windowEnd": "22:00",
"label": "Evening",
"dose": null,
"unitsPerDose": null,
"daysOfWeek": null,
"timesOfDay": [],
"reminderGraceMinutes": null,
"rrule": null,
"rollingIntervalDays": null,
"scheduleType": "SCHEDULED",
"cyclicOnWeeks": null,
"cyclicOffWeeks": null,
"doseWindows": null
}
],
"revisions": [],
"pauseEras": [],
"courses": [],
"intakes": [
{
"id": "<id:8>",
"userId": "<id:4>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-10T09:00:00.000Z",
"takenAt": "2026-10-10T09:30:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:9>",
"userId": "<id:4>",
"medicationId": "<id:1>",
"scheduledFor": "2026-10-11T08:00:00.000Z",
"takenAt": "2026-10-11T08:20:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:10>",
"userId": "<id:4>",
"medicationId": "<id:1>",
"scheduledFor": "2026-10-11T20:00:00.000Z",
"takenAt": "2026-10-11T20:20:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:11>",
"userId": "<id:4>",
"medicationId": "<id:1>",
"scheduledFor": "2026-10-12T08:00:00.000Z",
"takenAt": "2026-10-12T08:05:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "2026-10-12T09:00:00.000Z"
},
{
"id": "<id:12>",
"userId": "<id:4>",
"medicationId": "<id:1>",
"scheduledFor": "2026-10-12T20:00:00.000Z",
"takenAt": "2026-10-13T20:15:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "USER_PIN",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "<now>"
},
{
"id": "<id:13>",
"userId": "<id:4>",
"medicationId": "<id:1>",
"scheduledFor": "2026-10-13T08:00:00.000Z",
"takenAt": "2026-10-13T08:40:00.000Z",
"skipped": true,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:14>",
"userId": "<id:4>",
"medicationId": "<id:1>",
"scheduledFor": "2026-10-13T20:00:00.000Z",
"takenAt": "2026-10-13T20:15:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "<now>"
},
{
"id": "<id:2>",
"userId": "<id:4>",
"medicationId": "<id:1>",
"scheduledFor": "2026-10-13T20:00:00.000Z",
"takenAt": "2026-10-13T20:15:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "USER_PIN",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:15>",
"userId": "<id:4>",
"medicationId": "<id:1>",
"scheduledFor": "2026-10-14T08:00:00.000Z",
"takenAt": "2026-10-14T08:10:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "<now>"
},
{
"id": "<id:16>",
"userId": "<id:4>",
"medicationId": "<id:1>",
"scheduledFor": "2026-10-14T08:00:00.000Z",
"takenAt": "2026-10-14T08:45:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:17>",
"userId": "<id:4>",
"medicationId": "<id:1>",
"scheduledFor": "2026-10-14T20:00:00.000Z",
"takenAt": "2026-10-14T20:30:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "<now>"
}
],
"doseChanges": [],
"inventoryItems": [
{
"id": "<id:18>",
"userId": "<id:4>",
"medicationId": "<id:1>",
"state": "IN_USE",
"containerType": "OTHER",
"unitsTotal": "30",
"unitsRemaining": "30",
"firstUseAt": "2026-10-13T08:40:00.000Z",
"expiresAt": null,
"printedExpiry": null,
"purchasedAt": "2026-10-01T06:00:00.000Z",
"manufacturer": null,
"doseStrength": null,
"notes": null,
"notesEncrypted": null,
"createdAt": "<createdAt>",
"updatedAt": "<updatedAt>"
}
],
"inventoryEvents": [],
"categories": [],
"ingredients": [],
"audit": [
{
"action": "medication.intake.update",
"userId": "<id:4>",
"actorUserId": null,
"details": {
"eventId": "<id:15>",
"medicationId": "<id:1>",
"fields": [
"scheduledFor",
"takenAt"
],
"previous": {
"scheduledFor": "2026-10-14T08:00:00.000Z",
"takenAt": "2026-10-14T08:10:00.000Z"
}
},
"ipAddress": null
},
{
"action": "medication.intake.update",
"userId": "<id:4>",
"actorUserId": null,
"details": {
"eventId": "<id:17>",
"medicationId": "<id:1>",
"fields": [
"scheduledFor",
"takenAt"
],
"previous": {
"scheduledFor": "2026-10-14T20:00:00.000Z",
"takenAt": "2026-10-14T20:30:00.000Z"
}
},
"ipAddress": null
},
{
"action": "medication.intake.update",
"userId": "<id:4>",
"actorUserId": null,
"details": {
"eventId": "<id:12>",
"medicationId": "<id:1>",
"fields": [
"scheduledFor"
],
"previous": {
"scheduledFor": "2026-10-12T20:00:00.000Z"
}
},
"ipAddress": null
},
{
"action": "medication.intake.update",
"userId": "<id:4>",
"actorUserId": null,
"details": {
"eventId": "<id:14>",
"medicationId": "<id:1>",
"fields": [
"scheduledFor"
],
"previous": {
"scheduledFor": "2026-10-13T20:00:00.000Z"
}
},
"ipAddress": null
},
{
"action": "medication.intake.update",
"userId": "<id:4>",
"actorUserId": null,
"details": {
"eventId": "<id:13>",
"medicationId": "<id:1>",
"fields": [
"skipped"
],
"previous": {
"skipped": false
}
},
"ipAddress": null
},
{
"action": "medication.intake.update",
"userId": "<id:4>",
"actorUserId": null,
"details": {
"eventId": "<id:13>",
"medicationId": "<id:1>",
"fields": [
"takenAt"
],
"previous": {
"takenAt": null
}
},
"ipAddress": null
}
],
"idempotency": []
}
}
@@ -0,0 +1,534 @@
{
"status": 422,
"body": {
"data": null,
"error": "Validation failed",
"details": {
"issues": [
{
"path": "takenAt",
"code": "invalid_format",
"message": "Invalid ISO datetime"
},
{
"path": "skipped",
"code": "invalid_type",
"message": "Invalid input: expected boolean, received string"
}
]
},
"meta": {
"errorCode": "http.invalid",
"requestId": "<requestId>"
}
},
"events": [
{
"status": 422,
"action": {
"name": "medications.intake.event.update.validation-failed"
},
"meta": {
"issue_count": 2,
"medication_id": "<id:1>",
"event_id": "<id:2>",
"rejected_attempt": "medications.intake.event.update.validation-failed"
},
"warnings": null,
"error": null
}
],
"effects": [],
"stored": {
"medications": [
{
"id": "<id:3>",
"userId": "<id:4>",
"name": "Parity one-shot",
"dose": "10mg",
"treatmentClass": "GENERIC",
"dosesPerUnit": null,
"unitsPerDose": "1",
"active": false,
"notificationsEnabled": true,
"pausedAt": null,
"snoozedUntil": null,
"startsOn": "2026-10-01T00:00:00.000Z",
"endsOn": null,
"oneShot": true,
"asNeeded": false,
"trackIntake": true,
"autoMarkTaken": false,
"autoMarkTakenSince": null,
"deliveryForm": "ORAL",
"trackInjectionSites": false,
"allowedInjectionSites": [],
"liveActivityEnabled": false,
"criticalAlarmEnabled": false,
"atcCode": null,
"rxNormCode": null,
"lowStockNotifiedAt": null,
"lowStockNotifiedThresholdDays": null,
"reorderLeadDays": null,
"externalSource": null,
"externalId": null,
"createdAt": "<createdAt>",
"updatedAt": "<updatedAt>"
},
{
"id": "<id:1>",
"userId": "<id:4>",
"name": "Parity tablet",
"dose": "10mg",
"treatmentClass": "GENERIC",
"dosesPerUnit": null,
"unitsPerDose": "1",
"active": true,
"notificationsEnabled": true,
"pausedAt": null,
"snoozedUntil": null,
"startsOn": "2026-10-01T00:00:00.000Z",
"endsOn": null,
"oneShot": false,
"asNeeded": false,
"trackIntake": true,
"autoMarkTaken": false,
"autoMarkTakenSince": null,
"deliveryForm": "ORAL",
"trackInjectionSites": false,
"allowedInjectionSites": [],
"liveActivityEnabled": false,
"criticalAlarmEnabled": false,
"atcCode": null,
"rxNormCode": null,
"lowStockNotifiedAt": null,
"lowStockNotifiedThresholdDays": null,
"reorderLeadDays": null,
"externalSource": null,
"externalId": null,
"createdAt": "<createdAt>",
"updatedAt": "<updatedAt>"
}
],
"schedules": [
{
"id": "<id:5>",
"medicationId": "<id:1>",
"windowStart": "08:00",
"windowEnd": "10:00",
"label": "Morning",
"dose": null,
"unitsPerDose": null,
"daysOfWeek": null,
"timesOfDay": [],
"reminderGraceMinutes": null,
"rrule": null,
"rollingIntervalDays": null,
"scheduleType": "SCHEDULED",
"cyclicOnWeeks": null,
"cyclicOffWeeks": null,
"doseWindows": null
},
{
"id": "<id:6>",
"medicationId": "<id:3>",
"windowStart": "09:00",
"windowEnd": "11:00",
"label": null,
"dose": null,
"unitsPerDose": null,
"daysOfWeek": null,
"timesOfDay": [],
"reminderGraceMinutes": null,
"rrule": null,
"rollingIntervalDays": null,
"scheduleType": "SCHEDULED",
"cyclicOnWeeks": null,
"cyclicOffWeeks": null,
"doseWindows": null
},
{
"id": "<id:7>",
"medicationId": "<id:1>",
"windowStart": "20:00",
"windowEnd": "22:00",
"label": "Evening",
"dose": null,
"unitsPerDose": null,
"daysOfWeek": null,
"timesOfDay": [],
"reminderGraceMinutes": null,
"rrule": null,
"rollingIntervalDays": null,
"scheduleType": "SCHEDULED",
"cyclicOnWeeks": null,
"cyclicOffWeeks": null,
"doseWindows": null
}
],
"revisions": [],
"pauseEras": [],
"courses": [],
"intakes": [
{
"id": "<id:8>",
"userId": "<id:4>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-10T09:00:00.000Z",
"takenAt": "2026-10-10T09:30:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:9>",
"userId": "<id:4>",
"medicationId": "<id:1>",
"scheduledFor": "2026-10-11T08:00:00.000Z",
"takenAt": "2026-10-11T08:20:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:10>",
"userId": "<id:4>",
"medicationId": "<id:1>",
"scheduledFor": "2026-10-11T20:00:00.000Z",
"takenAt": "2026-10-11T20:20:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:11>",
"userId": "<id:4>",
"medicationId": "<id:1>",
"scheduledFor": "2026-10-12T08:00:00.000Z",
"takenAt": "2026-10-12T08:05:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "2026-10-12T09:00:00.000Z"
},
{
"id": "<id:12>",
"userId": "<id:4>",
"medicationId": "<id:1>",
"scheduledFor": "2026-10-12T20:00:00.000Z",
"takenAt": "2026-10-13T20:15:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "USER_PIN",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "<now>"
},
{
"id": "<id:13>",
"userId": "<id:4>",
"medicationId": "<id:1>",
"scheduledFor": "2026-10-13T08:00:00.000Z",
"takenAt": "2026-10-13T08:40:00.000Z",
"skipped": true,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:14>",
"userId": "<id:4>",
"medicationId": "<id:1>",
"scheduledFor": "2026-10-13T20:00:00.000Z",
"takenAt": "2026-10-13T20:15:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "<now>"
},
{
"id": "<id:2>",
"userId": "<id:4>",
"medicationId": "<id:1>",
"scheduledFor": "2026-10-13T20:00:00.000Z",
"takenAt": "2026-10-13T20:15:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "USER_PIN",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:15>",
"userId": "<id:4>",
"medicationId": "<id:1>",
"scheduledFor": "2026-10-14T08:00:00.000Z",
"takenAt": "2026-10-14T08:10:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "<now>"
},
{
"id": "<id:16>",
"userId": "<id:4>",
"medicationId": "<id:1>",
"scheduledFor": "2026-10-14T08:00:00.000Z",
"takenAt": "2026-10-14T08:45:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:17>",
"userId": "<id:4>",
"medicationId": "<id:1>",
"scheduledFor": "2026-10-14T20:00:00.000Z",
"takenAt": "2026-10-14T20:30:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "<now>"
}
],
"doseChanges": [],
"inventoryItems": [
{
"id": "<id:18>",
"userId": "<id:4>",
"medicationId": "<id:1>",
"state": "IN_USE",
"containerType": "OTHER",
"unitsTotal": "30",
"unitsRemaining": "30",
"firstUseAt": "2026-10-13T08:40:00.000Z",
"expiresAt": null,
"printedExpiry": null,
"purchasedAt": "2026-10-01T06:00:00.000Z",
"manufacturer": null,
"doseStrength": null,
"notes": null,
"notesEncrypted": null,
"createdAt": "<createdAt>",
"updatedAt": "<updatedAt>"
}
],
"inventoryEvents": [],
"categories": [],
"ingredients": [],
"audit": [
{
"action": "medication.intake.update",
"userId": "<id:4>",
"actorUserId": null,
"details": {
"eventId": "<id:15>",
"medicationId": "<id:1>",
"fields": [
"scheduledFor",
"takenAt"
],
"previous": {
"scheduledFor": "2026-10-14T08:00:00.000Z",
"takenAt": "2026-10-14T08:10:00.000Z"
}
},
"ipAddress": null
},
{
"action": "medication.intake.update",
"userId": "<id:4>",
"actorUserId": null,
"details": {
"eventId": "<id:17>",
"medicationId": "<id:1>",
"fields": [
"scheduledFor",
"takenAt"
],
"previous": {
"scheduledFor": "2026-10-14T20:00:00.000Z",
"takenAt": "2026-10-14T20:30:00.000Z"
}
},
"ipAddress": null
},
{
"action": "medication.intake.update",
"userId": "<id:4>",
"actorUserId": null,
"details": {
"eventId": "<id:12>",
"medicationId": "<id:1>",
"fields": [
"scheduledFor"
],
"previous": {
"scheduledFor": "2026-10-12T20:00:00.000Z"
}
},
"ipAddress": null
},
{
"action": "medication.intake.update",
"userId": "<id:4>",
"actorUserId": null,
"details": {
"eventId": "<id:14>",
"medicationId": "<id:1>",
"fields": [
"scheduledFor"
],
"previous": {
"scheduledFor": "2026-10-13T20:00:00.000Z"
}
},
"ipAddress": null
},
{
"action": "medication.intake.update",
"userId": "<id:4>",
"actorUserId": null,
"details": {
"eventId": "<id:13>",
"medicationId": "<id:1>",
"fields": [
"skipped"
],
"previous": {
"skipped": false
}
},
"ipAddress": null
},
{
"action": "medication.intake.update",
"userId": "<id:4>",
"actorUserId": null,
"details": {
"eventId": "<id:13>",
"medicationId": "<id:1>",
"fields": [
"takenAt"
],
"previous": {
"takenAt": null
}
},
"ipAddress": null
}
],
"idempotency": []
}
}
@@ -0,0 +1,513 @@
{
"status": 404,
"body": {
"data": null,
"error": "Intake not found",
"meta": {
"errorCode": "http.not_found",
"requestId": "<requestId>"
}
},
"events": [
{
"status": 404,
"action": null,
"meta": null,
"warnings": null,
"error": null
}
],
"effects": [],
"stored": {
"medications": [
{
"id": "<id:1>",
"userId": "<id:2>",
"name": "Parity one-shot",
"dose": "10mg",
"treatmentClass": "GENERIC",
"dosesPerUnit": null,
"unitsPerDose": "1",
"active": false,
"notificationsEnabled": true,
"pausedAt": null,
"snoozedUntil": null,
"startsOn": "2026-10-01T00:00:00.000Z",
"endsOn": null,
"oneShot": true,
"asNeeded": false,
"trackIntake": true,
"autoMarkTaken": false,
"autoMarkTakenSince": null,
"deliveryForm": "ORAL",
"trackInjectionSites": false,
"allowedInjectionSites": [],
"liveActivityEnabled": false,
"criticalAlarmEnabled": false,
"atcCode": null,
"rxNormCode": null,
"lowStockNotifiedAt": null,
"lowStockNotifiedThresholdDays": null,
"reorderLeadDays": null,
"externalSource": null,
"externalId": null,
"createdAt": "<createdAt>",
"updatedAt": "<updatedAt>"
},
{
"id": "<id:3>",
"userId": "<id:2>",
"name": "Parity tablet",
"dose": "10mg",
"treatmentClass": "GENERIC",
"dosesPerUnit": null,
"unitsPerDose": "1",
"active": true,
"notificationsEnabled": true,
"pausedAt": null,
"snoozedUntil": null,
"startsOn": "2026-10-01T00:00:00.000Z",
"endsOn": null,
"oneShot": false,
"asNeeded": false,
"trackIntake": true,
"autoMarkTaken": false,
"autoMarkTakenSince": null,
"deliveryForm": "ORAL",
"trackInjectionSites": false,
"allowedInjectionSites": [],
"liveActivityEnabled": false,
"criticalAlarmEnabled": false,
"atcCode": null,
"rxNormCode": null,
"lowStockNotifiedAt": null,
"lowStockNotifiedThresholdDays": null,
"reorderLeadDays": null,
"externalSource": null,
"externalId": null,
"createdAt": "<createdAt>",
"updatedAt": "<updatedAt>"
}
],
"schedules": [
{
"id": "<id:4>",
"medicationId": "<id:3>",
"windowStart": "08:00",
"windowEnd": "10:00",
"label": "Morning",
"dose": null,
"unitsPerDose": null,
"daysOfWeek": null,
"timesOfDay": [],
"reminderGraceMinutes": null,
"rrule": null,
"rollingIntervalDays": null,
"scheduleType": "SCHEDULED",
"cyclicOnWeeks": null,
"cyclicOffWeeks": null,
"doseWindows": null
},
{
"id": "<id:5>",
"medicationId": "<id:1>",
"windowStart": "09:00",
"windowEnd": "11:00",
"label": null,
"dose": null,
"unitsPerDose": null,
"daysOfWeek": null,
"timesOfDay": [],
"reminderGraceMinutes": null,
"rrule": null,
"rollingIntervalDays": null,
"scheduleType": "SCHEDULED",
"cyclicOnWeeks": null,
"cyclicOffWeeks": null,
"doseWindows": null
},
{
"id": "<id:6>",
"medicationId": "<id:3>",
"windowStart": "20:00",
"windowEnd": "22:00",
"label": "Evening",
"dose": null,
"unitsPerDose": null,
"daysOfWeek": null,
"timesOfDay": [],
"reminderGraceMinutes": null,
"rrule": null,
"rollingIntervalDays": null,
"scheduleType": "SCHEDULED",
"cyclicOnWeeks": null,
"cyclicOffWeeks": null,
"doseWindows": null
}
],
"revisions": [],
"pauseEras": [],
"courses": [],
"intakes": [
{
"id": "<id:7>",
"userId": "<id:2>",
"medicationId": "<id:1>",
"scheduledFor": "2026-10-10T09:00:00.000Z",
"takenAt": "2026-10-10T09:30:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:8>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-11T08:00:00.000Z",
"takenAt": "2026-10-11T08:20:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:9>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-11T20:00:00.000Z",
"takenAt": "2026-10-11T20:20:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:10>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-12T08:00:00.000Z",
"takenAt": "2026-10-12T08:05:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "2026-10-12T09:00:00.000Z"
},
{
"id": "<id:11>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-12T20:00:00.000Z",
"takenAt": "2026-10-13T20:15:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "USER_PIN",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "<now>"
},
{
"id": "<id:12>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-13T08:00:00.000Z",
"takenAt": "2026-10-13T08:40:00.000Z",
"skipped": true,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:13>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-13T20:00:00.000Z",
"takenAt": "2026-10-13T20:15:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "<now>"
},
{
"id": "<id:14>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-13T20:00:00.000Z",
"takenAt": "2026-10-13T20:15:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "USER_PIN",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:15>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-14T08:00:00.000Z",
"takenAt": "2026-10-14T08:10:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "<now>"
},
{
"id": "<id:16>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-14T08:00:00.000Z",
"takenAt": "2026-10-14T08:45:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:17>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-14T20:00:00.000Z",
"takenAt": "2026-10-14T20:30:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "<now>"
}
],
"doseChanges": [],
"inventoryItems": [
{
"id": "<id:18>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"state": "IN_USE",
"containerType": "OTHER",
"unitsTotal": "30",
"unitsRemaining": "30",
"firstUseAt": "2026-10-13T08:40:00.000Z",
"expiresAt": null,
"printedExpiry": null,
"purchasedAt": "2026-10-01T06:00:00.000Z",
"manufacturer": null,
"doseStrength": null,
"notes": null,
"notesEncrypted": null,
"createdAt": "<createdAt>",
"updatedAt": "<updatedAt>"
}
],
"inventoryEvents": [],
"categories": [],
"ingredients": [],
"audit": [
{
"action": "medication.intake.update",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"eventId": "<id:15>",
"medicationId": "<id:3>",
"fields": [
"scheduledFor",
"takenAt"
],
"previous": {
"scheduledFor": "2026-10-14T08:00:00.000Z",
"takenAt": "2026-10-14T08:10:00.000Z"
}
},
"ipAddress": null
},
{
"action": "medication.intake.update",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"eventId": "<id:17>",
"medicationId": "<id:3>",
"fields": [
"scheduledFor",
"takenAt"
],
"previous": {
"scheduledFor": "2026-10-14T20:00:00.000Z",
"takenAt": "2026-10-14T20:30:00.000Z"
}
},
"ipAddress": null
},
{
"action": "medication.intake.update",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"eventId": "<id:11>",
"medicationId": "<id:3>",
"fields": [
"scheduledFor"
],
"previous": {
"scheduledFor": "2026-10-12T20:00:00.000Z"
}
},
"ipAddress": null
},
{
"action": "medication.intake.update",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"eventId": "<id:13>",
"medicationId": "<id:3>",
"fields": [
"scheduledFor"
],
"previous": {
"scheduledFor": "2026-10-13T20:00:00.000Z"
}
},
"ipAddress": null
},
{
"action": "medication.intake.update",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"eventId": "<id:12>",
"medicationId": "<id:3>",
"fields": [
"skipped"
],
"previous": {
"skipped": false
}
},
"ipAddress": null
},
{
"action": "medication.intake.update",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"eventId": "<id:12>",
"medicationId": "<id:3>",
"fields": [
"takenAt"
],
"previous": {
"takenAt": null
}
},
"ipAddress": null
}
],
"idempotency": []
}
}
@@ -0,0 +1,513 @@
{
"status": 404,
"body": {
"data": null,
"error": "Intake not found",
"meta": {
"errorCode": "http.not_found",
"requestId": "<requestId>"
}
},
"events": [
{
"status": 404,
"action": null,
"meta": null,
"warnings": null,
"error": null
}
],
"effects": [],
"stored": {
"medications": [
{
"id": "<id:1>",
"userId": "<id:2>",
"name": "Parity one-shot",
"dose": "10mg",
"treatmentClass": "GENERIC",
"dosesPerUnit": null,
"unitsPerDose": "1",
"active": false,
"notificationsEnabled": true,
"pausedAt": null,
"snoozedUntil": null,
"startsOn": "2026-10-01T00:00:00.000Z",
"endsOn": null,
"oneShot": true,
"asNeeded": false,
"trackIntake": true,
"autoMarkTaken": false,
"autoMarkTakenSince": null,
"deliveryForm": "ORAL",
"trackInjectionSites": false,
"allowedInjectionSites": [],
"liveActivityEnabled": false,
"criticalAlarmEnabled": false,
"atcCode": null,
"rxNormCode": null,
"lowStockNotifiedAt": null,
"lowStockNotifiedThresholdDays": null,
"reorderLeadDays": null,
"externalSource": null,
"externalId": null,
"createdAt": "<createdAt>",
"updatedAt": "<updatedAt>"
},
{
"id": "<id:3>",
"userId": "<id:2>",
"name": "Parity tablet",
"dose": "10mg",
"treatmentClass": "GENERIC",
"dosesPerUnit": null,
"unitsPerDose": "1",
"active": true,
"notificationsEnabled": true,
"pausedAt": null,
"snoozedUntil": null,
"startsOn": "2026-10-01T00:00:00.000Z",
"endsOn": null,
"oneShot": false,
"asNeeded": false,
"trackIntake": true,
"autoMarkTaken": false,
"autoMarkTakenSince": null,
"deliveryForm": "ORAL",
"trackInjectionSites": false,
"allowedInjectionSites": [],
"liveActivityEnabled": false,
"criticalAlarmEnabled": false,
"atcCode": null,
"rxNormCode": null,
"lowStockNotifiedAt": null,
"lowStockNotifiedThresholdDays": null,
"reorderLeadDays": null,
"externalSource": null,
"externalId": null,
"createdAt": "<createdAt>",
"updatedAt": "<updatedAt>"
}
],
"schedules": [
{
"id": "<id:4>",
"medicationId": "<id:3>",
"windowStart": "08:00",
"windowEnd": "10:00",
"label": "Morning",
"dose": null,
"unitsPerDose": null,
"daysOfWeek": null,
"timesOfDay": [],
"reminderGraceMinutes": null,
"rrule": null,
"rollingIntervalDays": null,
"scheduleType": "SCHEDULED",
"cyclicOnWeeks": null,
"cyclicOffWeeks": null,
"doseWindows": null
},
{
"id": "<id:5>",
"medicationId": "<id:1>",
"windowStart": "09:00",
"windowEnd": "11:00",
"label": null,
"dose": null,
"unitsPerDose": null,
"daysOfWeek": null,
"timesOfDay": [],
"reminderGraceMinutes": null,
"rrule": null,
"rollingIntervalDays": null,
"scheduleType": "SCHEDULED",
"cyclicOnWeeks": null,
"cyclicOffWeeks": null,
"doseWindows": null
},
{
"id": "<id:6>",
"medicationId": "<id:3>",
"windowStart": "20:00",
"windowEnd": "22:00",
"label": "Evening",
"dose": null,
"unitsPerDose": null,
"daysOfWeek": null,
"timesOfDay": [],
"reminderGraceMinutes": null,
"rrule": null,
"rollingIntervalDays": null,
"scheduleType": "SCHEDULED",
"cyclicOnWeeks": null,
"cyclicOffWeeks": null,
"doseWindows": null
}
],
"revisions": [],
"pauseEras": [],
"courses": [],
"intakes": [
{
"id": "<id:7>",
"userId": "<id:2>",
"medicationId": "<id:1>",
"scheduledFor": "2026-10-10T09:00:00.000Z",
"takenAt": "2026-10-10T09:30:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:8>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-11T08:00:00.000Z",
"takenAt": "2026-10-11T08:20:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:9>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-11T20:00:00.000Z",
"takenAt": "2026-10-11T20:20:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:10>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-12T08:00:00.000Z",
"takenAt": "2026-10-12T08:05:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "2026-10-12T09:00:00.000Z"
},
{
"id": "<id:11>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-12T20:00:00.000Z",
"takenAt": "2026-10-13T20:15:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "USER_PIN",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "<now>"
},
{
"id": "<id:12>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-13T08:00:00.000Z",
"takenAt": "2026-10-13T08:40:00.000Z",
"skipped": true,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:13>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-13T20:00:00.000Z",
"takenAt": "2026-10-13T20:15:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "<now>"
},
{
"id": "<id:14>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-13T20:00:00.000Z",
"takenAt": "2026-10-13T20:15:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "USER_PIN",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:15>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-14T08:00:00.000Z",
"takenAt": "2026-10-14T08:10:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "<now>"
},
{
"id": "<id:16>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-14T08:00:00.000Z",
"takenAt": "2026-10-14T08:45:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:17>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-14T20:00:00.000Z",
"takenAt": "2026-10-14T20:30:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "<now>"
}
],
"doseChanges": [],
"inventoryItems": [
{
"id": "<id:18>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"state": "IN_USE",
"containerType": "OTHER",
"unitsTotal": "30",
"unitsRemaining": "30",
"firstUseAt": "2026-10-13T08:40:00.000Z",
"expiresAt": null,
"printedExpiry": null,
"purchasedAt": "2026-10-01T06:00:00.000Z",
"manufacturer": null,
"doseStrength": null,
"notes": null,
"notesEncrypted": null,
"createdAt": "<createdAt>",
"updatedAt": "<updatedAt>"
}
],
"inventoryEvents": [],
"categories": [],
"ingredients": [],
"audit": [
{
"action": "medication.intake.update",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"eventId": "<id:15>",
"medicationId": "<id:3>",
"fields": [
"scheduledFor",
"takenAt"
],
"previous": {
"scheduledFor": "2026-10-14T08:00:00.000Z",
"takenAt": "2026-10-14T08:10:00.000Z"
}
},
"ipAddress": null
},
{
"action": "medication.intake.update",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"eventId": "<id:17>",
"medicationId": "<id:3>",
"fields": [
"scheduledFor",
"takenAt"
],
"previous": {
"scheduledFor": "2026-10-14T20:00:00.000Z",
"takenAt": "2026-10-14T20:30:00.000Z"
}
},
"ipAddress": null
},
{
"action": "medication.intake.update",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"eventId": "<id:11>",
"medicationId": "<id:3>",
"fields": [
"scheduledFor"
],
"previous": {
"scheduledFor": "2026-10-12T20:00:00.000Z"
}
},
"ipAddress": null
},
{
"action": "medication.intake.update",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"eventId": "<id:13>",
"medicationId": "<id:3>",
"fields": [
"scheduledFor"
],
"previous": {
"scheduledFor": "2026-10-13T20:00:00.000Z"
}
},
"ipAddress": null
},
{
"action": "medication.intake.update",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"eventId": "<id:12>",
"medicationId": "<id:3>",
"fields": [
"skipped"
],
"previous": {
"skipped": false
}
},
"ipAddress": null
},
{
"action": "medication.intake.update",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"eventId": "<id:12>",
"medicationId": "<id:3>",
"fields": [
"takenAt"
],
"previous": {
"takenAt": null
}
},
"ipAddress": null
}
],
"idempotency": []
}
}
@@ -0,0 +1,518 @@
{
"status": 403,
"body": {
"data": null,
"error": "Account access denied",
"meta": {
"errorCode": "sharing.access.denied",
"requestId": "<requestId>"
}
},
"events": [
{
"status": 403,
"action": null,
"meta": {
"sharing_refusal": "insufficient_access"
},
"warnings": null,
"error": {
"type": "SharingAccessDeniedError",
"message": "Account access denied"
}
}
],
"effects": [],
"stored": {
"medications": [
{
"id": "<id:1>",
"userId": "<id:2>",
"name": "Parity one-shot",
"dose": "10mg",
"treatmentClass": "GENERIC",
"dosesPerUnit": null,
"unitsPerDose": "1",
"active": false,
"notificationsEnabled": true,
"pausedAt": null,
"snoozedUntil": null,
"startsOn": "2026-10-01T00:00:00.000Z",
"endsOn": null,
"oneShot": true,
"asNeeded": false,
"trackIntake": true,
"autoMarkTaken": false,
"autoMarkTakenSince": null,
"deliveryForm": "ORAL",
"trackInjectionSites": false,
"allowedInjectionSites": [],
"liveActivityEnabled": false,
"criticalAlarmEnabled": false,
"atcCode": null,
"rxNormCode": null,
"lowStockNotifiedAt": null,
"lowStockNotifiedThresholdDays": null,
"reorderLeadDays": null,
"externalSource": null,
"externalId": null,
"createdAt": "<createdAt>",
"updatedAt": "<updatedAt>"
},
{
"id": "<id:3>",
"userId": "<id:2>",
"name": "Parity tablet",
"dose": "10mg",
"treatmentClass": "GENERIC",
"dosesPerUnit": null,
"unitsPerDose": "1",
"active": true,
"notificationsEnabled": true,
"pausedAt": null,
"snoozedUntil": null,
"startsOn": "2026-10-01T00:00:00.000Z",
"endsOn": null,
"oneShot": false,
"asNeeded": false,
"trackIntake": true,
"autoMarkTaken": false,
"autoMarkTakenSince": null,
"deliveryForm": "ORAL",
"trackInjectionSites": false,
"allowedInjectionSites": [],
"liveActivityEnabled": false,
"criticalAlarmEnabled": false,
"atcCode": null,
"rxNormCode": null,
"lowStockNotifiedAt": null,
"lowStockNotifiedThresholdDays": null,
"reorderLeadDays": null,
"externalSource": null,
"externalId": null,
"createdAt": "<createdAt>",
"updatedAt": "<updatedAt>"
}
],
"schedules": [
{
"id": "<id:4>",
"medicationId": "<id:3>",
"windowStart": "08:00",
"windowEnd": "10:00",
"label": "Morning",
"dose": null,
"unitsPerDose": null,
"daysOfWeek": null,
"timesOfDay": [],
"reminderGraceMinutes": null,
"rrule": null,
"rollingIntervalDays": null,
"scheduleType": "SCHEDULED",
"cyclicOnWeeks": null,
"cyclicOffWeeks": null,
"doseWindows": null
},
{
"id": "<id:5>",
"medicationId": "<id:1>",
"windowStart": "09:00",
"windowEnd": "11:00",
"label": null,
"dose": null,
"unitsPerDose": null,
"daysOfWeek": null,
"timesOfDay": [],
"reminderGraceMinutes": null,
"rrule": null,
"rollingIntervalDays": null,
"scheduleType": "SCHEDULED",
"cyclicOnWeeks": null,
"cyclicOffWeeks": null,
"doseWindows": null
},
{
"id": "<id:6>",
"medicationId": "<id:3>",
"windowStart": "20:00",
"windowEnd": "22:00",
"label": "Evening",
"dose": null,
"unitsPerDose": null,
"daysOfWeek": null,
"timesOfDay": [],
"reminderGraceMinutes": null,
"rrule": null,
"rollingIntervalDays": null,
"scheduleType": "SCHEDULED",
"cyclicOnWeeks": null,
"cyclicOffWeeks": null,
"doseWindows": null
}
],
"revisions": [],
"pauseEras": [],
"courses": [],
"intakes": [
{
"id": "<id:7>",
"userId": "<id:2>",
"medicationId": "<id:1>",
"scheduledFor": "2026-10-10T09:00:00.000Z",
"takenAt": "2026-10-10T09:30:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:8>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-11T08:00:00.000Z",
"takenAt": "2026-10-11T08:20:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:9>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-11T20:00:00.000Z",
"takenAt": "2026-10-11T20:20:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:10>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-12T08:00:00.000Z",
"takenAt": "2026-10-12T08:05:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "2026-10-12T09:00:00.000Z"
},
{
"id": "<id:11>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-12T20:00:00.000Z",
"takenAt": "2026-10-13T20:15:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "USER_PIN",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "<now>"
},
{
"id": "<id:12>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-13T08:00:00.000Z",
"takenAt": "2026-10-13T08:40:00.000Z",
"skipped": true,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:13>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-13T20:00:00.000Z",
"takenAt": "2026-10-13T20:15:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "<now>"
},
{
"id": "<id:14>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-13T20:00:00.000Z",
"takenAt": "2026-10-13T20:15:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "USER_PIN",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:15>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-14T08:00:00.000Z",
"takenAt": "2026-10-14T08:10:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "<now>"
},
{
"id": "<id:16>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-14T08:00:00.000Z",
"takenAt": "2026-10-14T08:45:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:17>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-14T20:00:00.000Z",
"takenAt": "2026-10-14T20:30:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "<now>"
}
],
"doseChanges": [],
"inventoryItems": [
{
"id": "<id:18>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"state": "IN_USE",
"containerType": "OTHER",
"unitsTotal": "30",
"unitsRemaining": "30",
"firstUseAt": "2026-10-13T08:40:00.000Z",
"expiresAt": null,
"printedExpiry": null,
"purchasedAt": "2026-10-01T06:00:00.000Z",
"manufacturer": null,
"doseStrength": null,
"notes": null,
"notesEncrypted": null,
"createdAt": "<createdAt>",
"updatedAt": "<updatedAt>"
}
],
"inventoryEvents": [],
"categories": [],
"ingredients": [],
"audit": [
{
"action": "medication.intake.update",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"eventId": "<id:15>",
"medicationId": "<id:3>",
"fields": [
"scheduledFor",
"takenAt"
],
"previous": {
"scheduledFor": "2026-10-14T08:00:00.000Z",
"takenAt": "2026-10-14T08:10:00.000Z"
}
},
"ipAddress": null
},
{
"action": "medication.intake.update",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"eventId": "<id:17>",
"medicationId": "<id:3>",
"fields": [
"scheduledFor",
"takenAt"
],
"previous": {
"scheduledFor": "2026-10-14T20:00:00.000Z",
"takenAt": "2026-10-14T20:30:00.000Z"
}
},
"ipAddress": null
},
{
"action": "medication.intake.update",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"eventId": "<id:11>",
"medicationId": "<id:3>",
"fields": [
"scheduledFor"
],
"previous": {
"scheduledFor": "2026-10-12T20:00:00.000Z"
}
},
"ipAddress": null
},
{
"action": "medication.intake.update",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"eventId": "<id:13>",
"medicationId": "<id:3>",
"fields": [
"scheduledFor"
],
"previous": {
"scheduledFor": "2026-10-13T20:00:00.000Z"
}
},
"ipAddress": null
},
{
"action": "medication.intake.update",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"eventId": "<id:12>",
"medicationId": "<id:3>",
"fields": [
"skipped"
],
"previous": {
"skipped": false
}
},
"ipAddress": null
},
{
"action": "medication.intake.update",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"eventId": "<id:12>",
"medicationId": "<id:3>",
"fields": [
"takenAt"
],
"previous": {
"takenAt": null
}
},
"ipAddress": null
}
],
"idempotency": []
}
}
@@ -0,0 +1,561 @@
{
"status": 200,
"body": {
"data": {
"id": "<id:1>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-13T20:00:00.000Z",
"takenAt": "2026-10-13T20:50:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
"error": null
},
"events": [
{
"status": 200,
"action": {
"name": "medication.intake.update",
"entity_type": "intake_event",
"entity_id": "<id:1>"
},
"meta": {
"medication_id": "<id:3>"
},
"warnings": null,
"error": null
}
],
"effects": [
{
"effect": "queueMedicationIntakeSync",
"args": [
{
"userId": "<id:2>",
"originDeviceToken": null
}
]
}
],
"stored": {
"medications": [
{
"id": "<id:4>",
"userId": "<id:2>",
"name": "Parity one-shot",
"dose": "10mg",
"treatmentClass": "GENERIC",
"dosesPerUnit": null,
"unitsPerDose": "1",
"active": false,
"notificationsEnabled": true,
"pausedAt": null,
"snoozedUntil": null,
"startsOn": "2026-10-01T00:00:00.000Z",
"endsOn": null,
"oneShot": true,
"asNeeded": false,
"trackIntake": true,
"autoMarkTaken": false,
"autoMarkTakenSince": null,
"deliveryForm": "ORAL",
"trackInjectionSites": false,
"allowedInjectionSites": [],
"liveActivityEnabled": false,
"criticalAlarmEnabled": false,
"atcCode": null,
"rxNormCode": null,
"lowStockNotifiedAt": null,
"lowStockNotifiedThresholdDays": null,
"reorderLeadDays": null,
"externalSource": null,
"externalId": null,
"createdAt": "<createdAt>",
"updatedAt": "<updatedAt>"
},
{
"id": "<id:3>",
"userId": "<id:2>",
"name": "Parity tablet",
"dose": "10mg",
"treatmentClass": "GENERIC",
"dosesPerUnit": null,
"unitsPerDose": "1",
"active": true,
"notificationsEnabled": true,
"pausedAt": null,
"snoozedUntil": null,
"startsOn": "2026-10-01T00:00:00.000Z",
"endsOn": null,
"oneShot": false,
"asNeeded": false,
"trackIntake": true,
"autoMarkTaken": false,
"autoMarkTakenSince": null,
"deliveryForm": "ORAL",
"trackInjectionSites": false,
"allowedInjectionSites": [],
"liveActivityEnabled": false,
"criticalAlarmEnabled": false,
"atcCode": null,
"rxNormCode": null,
"lowStockNotifiedAt": null,
"lowStockNotifiedThresholdDays": null,
"reorderLeadDays": null,
"externalSource": null,
"externalId": null,
"createdAt": "<createdAt>",
"updatedAt": "<updatedAt>"
}
],
"schedules": [
{
"id": "<id:5>",
"medicationId": "<id:3>",
"windowStart": "08:00",
"windowEnd": "10:00",
"label": "Morning",
"dose": null,
"unitsPerDose": null,
"daysOfWeek": null,
"timesOfDay": [],
"reminderGraceMinutes": null,
"rrule": null,
"rollingIntervalDays": null,
"scheduleType": "SCHEDULED",
"cyclicOnWeeks": null,
"cyclicOffWeeks": null,
"doseWindows": null
},
{
"id": "<id:6>",
"medicationId": "<id:4>",
"windowStart": "09:00",
"windowEnd": "11:00",
"label": null,
"dose": null,
"unitsPerDose": null,
"daysOfWeek": null,
"timesOfDay": [],
"reminderGraceMinutes": null,
"rrule": null,
"rollingIntervalDays": null,
"scheduleType": "SCHEDULED",
"cyclicOnWeeks": null,
"cyclicOffWeeks": null,
"doseWindows": null
},
{
"id": "<id:7>",
"medicationId": "<id:3>",
"windowStart": "20:00",
"windowEnd": "22:00",
"label": "Evening",
"dose": null,
"unitsPerDose": null,
"daysOfWeek": null,
"timesOfDay": [],
"reminderGraceMinutes": null,
"rrule": null,
"rollingIntervalDays": null,
"scheduleType": "SCHEDULED",
"cyclicOnWeeks": null,
"cyclicOffWeeks": null,
"doseWindows": null
}
],
"revisions": [],
"pauseEras": [],
"courses": [],
"intakes": [
{
"id": "<id:8>",
"userId": "<id:2>",
"medicationId": "<id:4>",
"scheduledFor": "2026-10-10T09:00:00.000Z",
"takenAt": "2026-10-10T09:30:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:9>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-11T08:00:00.000Z",
"takenAt": "2026-10-11T08:20:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:10>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-11T20:00:00.000Z",
"takenAt": "2026-10-11T20:20:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:11>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-12T08:00:00.000Z",
"takenAt": "2026-10-12T08:05:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "2026-10-12T09:00:00.000Z"
},
{
"id": "<id:12>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-12T20:00:00.000Z",
"takenAt": "2026-10-13T20:15:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "USER_PIN",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "<now>"
},
{
"id": "<id:13>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-13T08:00:00.000Z",
"takenAt": "2026-10-13T08:40:00.000Z",
"skipped": true,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:14>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-13T20:00:00.000Z",
"takenAt": "2026-10-13T20:15:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "<now>"
},
{
"id": "<id:1>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-13T20:00:00.000Z",
"takenAt": "2026-10-13T20:50:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:15>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-14T08:00:00.000Z",
"takenAt": "2026-10-14T08:10:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "<now>"
},
{
"id": "<id:16>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-14T08:00:00.000Z",
"takenAt": "2026-10-14T08:45:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:17>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-14T20:00:00.000Z",
"takenAt": "2026-10-14T20:30:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "<now>"
}
],
"doseChanges": [],
"inventoryItems": [
{
"id": "<id:18>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"state": "IN_USE",
"containerType": "OTHER",
"unitsTotal": "30",
"unitsRemaining": "30",
"firstUseAt": "2026-10-13T08:40:00.000Z",
"expiresAt": null,
"printedExpiry": null,
"purchasedAt": "2026-10-01T06:00:00.000Z",
"manufacturer": null,
"doseStrength": null,
"notes": null,
"notesEncrypted": null,
"createdAt": "<createdAt>",
"updatedAt": "<updatedAt>"
}
],
"inventoryEvents": [],
"categories": [],
"ingredients": [],
"audit": [
{
"action": "medication.intake.update",
"userId": "<id:2>",
"actorUserId": "<id:19>",
"details": {
"eventId": "<id:1>",
"medicationId": "<id:3>",
"fields": [
"takenAt"
],
"previous": {
"takenAt": "2026-10-13T20:15:00.000Z"
}
},
"ipAddress": null
},
{
"action": "medication.intake.update",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"eventId": "<id:15>",
"medicationId": "<id:3>",
"fields": [
"scheduledFor",
"takenAt"
],
"previous": {
"scheduledFor": "2026-10-14T08:00:00.000Z",
"takenAt": "2026-10-14T08:10:00.000Z"
}
},
"ipAddress": null
},
{
"action": "medication.intake.update",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"eventId": "<id:17>",
"medicationId": "<id:3>",
"fields": [
"scheduledFor",
"takenAt"
],
"previous": {
"scheduledFor": "2026-10-14T20:00:00.000Z",
"takenAt": "2026-10-14T20:30:00.000Z"
}
},
"ipAddress": null
},
{
"action": "medication.intake.update",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"eventId": "<id:12>",
"medicationId": "<id:3>",
"fields": [
"scheduledFor"
],
"previous": {
"scheduledFor": "2026-10-12T20:00:00.000Z"
}
},
"ipAddress": null
},
{
"action": "medication.intake.update",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"eventId": "<id:14>",
"medicationId": "<id:3>",
"fields": [
"scheduledFor"
],
"previous": {
"scheduledFor": "2026-10-13T20:00:00.000Z"
}
},
"ipAddress": null
},
{
"action": "medication.intake.update",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"eventId": "<id:13>",
"medicationId": "<id:3>",
"fields": [
"skipped"
],
"previous": {
"skipped": false
}
},
"ipAddress": null
},
{
"action": "medication.intake.update",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"eventId": "<id:13>",
"medicationId": "<id:3>",
"fields": [
"takenAt"
],
"previous": {
"takenAt": null
}
},
"ipAddress": null
}
],
"idempotency": []
}
}
@@ -0,0 +1,532 @@
{
"status": 401,
"body": {
"data": null,
"error": "Not authenticated",
"meta": {
"errorCode": "auth.missing",
"requestId": "<requestId>"
}
},
"events": [
{
"status": 401,
"action": null,
"meta": null,
"warnings": null,
"error": {
"type": "HttpError",
"message": "Not authenticated"
}
}
],
"effects": [],
"stored": {
"medications": [
{
"id": "<id:1>",
"userId": "<id:2>",
"name": "Parity one-shot",
"dose": "10mg",
"treatmentClass": "GENERIC",
"dosesPerUnit": null,
"unitsPerDose": "1",
"active": false,
"notificationsEnabled": true,
"pausedAt": null,
"snoozedUntil": null,
"startsOn": "2026-10-01T00:00:00.000Z",
"endsOn": null,
"oneShot": true,
"asNeeded": false,
"trackIntake": true,
"autoMarkTaken": false,
"autoMarkTakenSince": null,
"deliveryForm": "ORAL",
"trackInjectionSites": false,
"allowedInjectionSites": [],
"liveActivityEnabled": false,
"criticalAlarmEnabled": false,
"atcCode": null,
"rxNormCode": null,
"lowStockNotifiedAt": null,
"lowStockNotifiedThresholdDays": null,
"reorderLeadDays": null,
"externalSource": null,
"externalId": null,
"createdAt": "<createdAt>",
"updatedAt": "<updatedAt>"
},
{
"id": "<id:3>",
"userId": "<id:2>",
"name": "Parity tablet",
"dose": "10mg",
"treatmentClass": "GENERIC",
"dosesPerUnit": null,
"unitsPerDose": "1",
"active": true,
"notificationsEnabled": true,
"pausedAt": null,
"snoozedUntil": null,
"startsOn": "2026-10-01T00:00:00.000Z",
"endsOn": null,
"oneShot": false,
"asNeeded": false,
"trackIntake": true,
"autoMarkTaken": false,
"autoMarkTakenSince": null,
"deliveryForm": "ORAL",
"trackInjectionSites": false,
"allowedInjectionSites": [],
"liveActivityEnabled": false,
"criticalAlarmEnabled": false,
"atcCode": null,
"rxNormCode": null,
"lowStockNotifiedAt": null,
"lowStockNotifiedThresholdDays": null,
"reorderLeadDays": null,
"externalSource": null,
"externalId": null,
"createdAt": "<createdAt>",
"updatedAt": "<updatedAt>"
}
],
"schedules": [
{
"id": "<id:4>",
"medicationId": "<id:3>",
"windowStart": "08:00",
"windowEnd": "10:00",
"label": "Morning",
"dose": null,
"unitsPerDose": null,
"daysOfWeek": null,
"timesOfDay": [],
"reminderGraceMinutes": null,
"rrule": null,
"rollingIntervalDays": null,
"scheduleType": "SCHEDULED",
"cyclicOnWeeks": null,
"cyclicOffWeeks": null,
"doseWindows": null
},
{
"id": "<id:5>",
"medicationId": "<id:1>",
"windowStart": "09:00",
"windowEnd": "11:00",
"label": null,
"dose": null,
"unitsPerDose": null,
"daysOfWeek": null,
"timesOfDay": [],
"reminderGraceMinutes": null,
"rrule": null,
"rollingIntervalDays": null,
"scheduleType": "SCHEDULED",
"cyclicOnWeeks": null,
"cyclicOffWeeks": null,
"doseWindows": null
},
{
"id": "<id:6>",
"medicationId": "<id:3>",
"windowStart": "20:00",
"windowEnd": "22:00",
"label": "Evening",
"dose": null,
"unitsPerDose": null,
"daysOfWeek": null,
"timesOfDay": [],
"reminderGraceMinutes": null,
"rrule": null,
"rollingIntervalDays": null,
"scheduleType": "SCHEDULED",
"cyclicOnWeeks": null,
"cyclicOffWeeks": null,
"doseWindows": null
}
],
"revisions": [],
"pauseEras": [],
"courses": [],
"intakes": [
{
"id": "<id:7>",
"userId": "<id:2>",
"medicationId": "<id:1>",
"scheduledFor": "2026-10-10T09:00:00.000Z",
"takenAt": "2026-10-10T09:30:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:8>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-11T08:00:00.000Z",
"takenAt": "2026-10-11T08:20:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:9>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-11T20:00:00.000Z",
"takenAt": "2026-10-11T20:20:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:10>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-12T08:00:00.000Z",
"takenAt": "2026-10-12T08:05:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "2026-10-12T09:00:00.000Z"
},
{
"id": "<id:11>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-12T20:00:00.000Z",
"takenAt": "2026-10-13T20:15:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "USER_PIN",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "<now>"
},
{
"id": "<id:12>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-13T08:00:00.000Z",
"takenAt": "2026-10-13T08:40:00.000Z",
"skipped": true,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:13>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-13T20:00:00.000Z",
"takenAt": "2026-10-13T20:15:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "<now>"
},
{
"id": "<id:14>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-13T20:00:00.000Z",
"takenAt": "2026-10-13T20:50:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:15>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-14T08:00:00.000Z",
"takenAt": "2026-10-14T08:10:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "<now>"
},
{
"id": "<id:16>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-14T08:00:00.000Z",
"takenAt": "2026-10-14T08:45:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:17>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-14T20:00:00.000Z",
"takenAt": "2026-10-14T20:30:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "<now>"
}
],
"doseChanges": [],
"inventoryItems": [
{
"id": "<id:18>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"state": "IN_USE",
"containerType": "OTHER",
"unitsTotal": "30",
"unitsRemaining": "30",
"firstUseAt": "2026-10-13T08:40:00.000Z",
"expiresAt": null,
"printedExpiry": null,
"purchasedAt": "2026-10-01T06:00:00.000Z",
"manufacturer": null,
"doseStrength": null,
"notes": null,
"notesEncrypted": null,
"createdAt": "<createdAt>",
"updatedAt": "<updatedAt>"
}
],
"inventoryEvents": [],
"categories": [],
"ingredients": [],
"audit": [
{
"action": "medication.intake.update",
"userId": "<id:2>",
"actorUserId": "<id:19>",
"details": {
"eventId": "<id:14>",
"medicationId": "<id:3>",
"fields": [
"takenAt"
],
"previous": {
"takenAt": "2026-10-13T20:15:00.000Z"
}
},
"ipAddress": null
},
{
"action": "medication.intake.update",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"eventId": "<id:15>",
"medicationId": "<id:3>",
"fields": [
"scheduledFor",
"takenAt"
],
"previous": {
"scheduledFor": "2026-10-14T08:00:00.000Z",
"takenAt": "2026-10-14T08:10:00.000Z"
}
},
"ipAddress": null
},
{
"action": "medication.intake.update",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"eventId": "<id:17>",
"medicationId": "<id:3>",
"fields": [
"scheduledFor",
"takenAt"
],
"previous": {
"scheduledFor": "2026-10-14T20:00:00.000Z",
"takenAt": "2026-10-14T20:30:00.000Z"
}
},
"ipAddress": null
},
{
"action": "medication.intake.update",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"eventId": "<id:11>",
"medicationId": "<id:3>",
"fields": [
"scheduledFor"
],
"previous": {
"scheduledFor": "2026-10-12T20:00:00.000Z"
}
},
"ipAddress": null
},
{
"action": "medication.intake.update",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"eventId": "<id:13>",
"medicationId": "<id:3>",
"fields": [
"scheduledFor"
],
"previous": {
"scheduledFor": "2026-10-13T20:00:00.000Z"
}
},
"ipAddress": null
},
{
"action": "medication.intake.update",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"eventId": "<id:12>",
"medicationId": "<id:3>",
"fields": [
"skipped"
],
"previous": {
"skipped": false
}
},
"ipAddress": null
},
{
"action": "medication.intake.update",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"eventId": "<id:12>",
"medicationId": "<id:3>",
"fields": [
"takenAt"
],
"previous": {
"takenAt": null
}
},
"ipAddress": null
}
],
"idempotency": []
}
}
@@ -0,0 +1,553 @@
{
"status": 200,
"body": {
"data": {
"deleted": true
},
"error": null
},
"events": [
{
"status": 200,
"action": {
"name": "medication.intake.delete",
"entity_type": "intake_event",
"entity_id": "<id:1>"
},
"meta": {
"medication_id": "<id:2>"
},
"warnings": null,
"error": null
}
],
"effects": [
{
"effect": "queueMedicationIntakeSync",
"args": [
{
"userId": "<id:3>",
"originDeviceToken": null
}
]
}
],
"stored": {
"medications": [
{
"id": "<id:4>",
"userId": "<id:3>",
"name": "Parity one-shot",
"dose": "10mg",
"treatmentClass": "GENERIC",
"dosesPerUnit": null,
"unitsPerDose": "1",
"active": false,
"notificationsEnabled": true,
"pausedAt": null,
"snoozedUntil": null,
"startsOn": "2026-10-01T00:00:00.000Z",
"endsOn": null,
"oneShot": true,
"asNeeded": false,
"trackIntake": true,
"autoMarkTaken": false,
"autoMarkTakenSince": null,
"deliveryForm": "ORAL",
"trackInjectionSites": false,
"allowedInjectionSites": [],
"liveActivityEnabled": false,
"criticalAlarmEnabled": false,
"atcCode": null,
"rxNormCode": null,
"lowStockNotifiedAt": null,
"lowStockNotifiedThresholdDays": null,
"reorderLeadDays": null,
"externalSource": null,
"externalId": null,
"createdAt": "<createdAt>",
"updatedAt": "<updatedAt>"
},
{
"id": "<id:2>",
"userId": "<id:3>",
"name": "Parity tablet",
"dose": "10mg",
"treatmentClass": "GENERIC",
"dosesPerUnit": null,
"unitsPerDose": "1",
"active": true,
"notificationsEnabled": true,
"pausedAt": null,
"snoozedUntil": null,
"startsOn": "2026-10-01T00:00:00.000Z",
"endsOn": null,
"oneShot": false,
"asNeeded": false,
"trackIntake": true,
"autoMarkTaken": false,
"autoMarkTakenSince": null,
"deliveryForm": "ORAL",
"trackInjectionSites": false,
"allowedInjectionSites": [],
"liveActivityEnabled": false,
"criticalAlarmEnabled": false,
"atcCode": null,
"rxNormCode": null,
"lowStockNotifiedAt": null,
"lowStockNotifiedThresholdDays": null,
"reorderLeadDays": null,
"externalSource": null,
"externalId": null,
"createdAt": "<createdAt>",
"updatedAt": "<updatedAt>"
}
],
"schedules": [
{
"id": "<id:5>",
"medicationId": "<id:2>",
"windowStart": "08:00",
"windowEnd": "10:00",
"label": "Morning",
"dose": null,
"unitsPerDose": null,
"daysOfWeek": null,
"timesOfDay": [],
"reminderGraceMinutes": null,
"rrule": null,
"rollingIntervalDays": null,
"scheduleType": "SCHEDULED",
"cyclicOnWeeks": null,
"cyclicOffWeeks": null,
"doseWindows": null
},
{
"id": "<id:6>",
"medicationId": "<id:4>",
"windowStart": "09:00",
"windowEnd": "11:00",
"label": null,
"dose": null,
"unitsPerDose": null,
"daysOfWeek": null,
"timesOfDay": [],
"reminderGraceMinutes": null,
"rrule": null,
"rollingIntervalDays": null,
"scheduleType": "SCHEDULED",
"cyclicOnWeeks": null,
"cyclicOffWeeks": null,
"doseWindows": null
},
{
"id": "<id:7>",
"medicationId": "<id:2>",
"windowStart": "20:00",
"windowEnd": "22:00",
"label": "Evening",
"dose": null,
"unitsPerDose": null,
"daysOfWeek": null,
"timesOfDay": [],
"reminderGraceMinutes": null,
"rrule": null,
"rollingIntervalDays": null,
"scheduleType": "SCHEDULED",
"cyclicOnWeeks": null,
"cyclicOffWeeks": null,
"doseWindows": null
}
],
"revisions": [],
"pauseEras": [],
"courses": [],
"intakes": [
{
"id": "<id:8>",
"userId": "<id:3>",
"medicationId": "<id:4>",
"scheduledFor": "2026-10-10T09:00:00.000Z",
"takenAt": "2026-10-10T09:30:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:1>",
"userId": "<id:3>",
"medicationId": "<id:2>",
"scheduledFor": "2026-10-11T08:00:00.000Z",
"takenAt": "2026-10-11T08:20:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "<now>"
},
{
"id": "<id:9>",
"userId": "<id:3>",
"medicationId": "<id:2>",
"scheduledFor": "2026-10-11T20:00:00.000Z",
"takenAt": "2026-10-11T20:20:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:10>",
"userId": "<id:3>",
"medicationId": "<id:2>",
"scheduledFor": "2026-10-12T08:00:00.000Z",
"takenAt": "2026-10-12T08:05:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "2026-10-12T09:00:00.000Z"
},
{
"id": "<id:11>",
"userId": "<id:3>",
"medicationId": "<id:2>",
"scheduledFor": "2026-10-12T20:00:00.000Z",
"takenAt": "2026-10-13T20:15:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "USER_PIN",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "<now>"
},
{
"id": "<id:12>",
"userId": "<id:3>",
"medicationId": "<id:2>",
"scheduledFor": "2026-10-13T08:00:00.000Z",
"takenAt": "2026-10-13T08:40:00.000Z",
"skipped": true,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:13>",
"userId": "<id:3>",
"medicationId": "<id:2>",
"scheduledFor": "2026-10-13T20:00:00.000Z",
"takenAt": "2026-10-13T20:15:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "<now>"
},
{
"id": "<id:14>",
"userId": "<id:3>",
"medicationId": "<id:2>",
"scheduledFor": "2026-10-13T20:00:00.000Z",
"takenAt": "2026-10-13T20:50:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:15>",
"userId": "<id:3>",
"medicationId": "<id:2>",
"scheduledFor": "2026-10-14T08:00:00.000Z",
"takenAt": "2026-10-14T08:10:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "<now>"
},
{
"id": "<id:16>",
"userId": "<id:3>",
"medicationId": "<id:2>",
"scheduledFor": "2026-10-14T08:00:00.000Z",
"takenAt": "2026-10-14T08:45:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:17>",
"userId": "<id:3>",
"medicationId": "<id:2>",
"scheduledFor": "2026-10-14T20:00:00.000Z",
"takenAt": "2026-10-14T20:30:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "<now>"
}
],
"doseChanges": [],
"inventoryItems": [
{
"id": "<id:18>",
"userId": "<id:3>",
"medicationId": "<id:2>",
"state": "IN_USE",
"containerType": "OTHER",
"unitsTotal": "30",
"unitsRemaining": "30",
"firstUseAt": "2026-10-13T08:40:00.000Z",
"expiresAt": null,
"printedExpiry": null,
"purchasedAt": "2026-10-01T06:00:00.000Z",
"manufacturer": null,
"doseStrength": null,
"notes": null,
"notesEncrypted": null,
"createdAt": "<createdAt>",
"updatedAt": "<updatedAt>"
}
],
"inventoryEvents": [],
"categories": [],
"ingredients": [],
"audit": [
{
"action": "medication.intake.delete",
"userId": "<id:3>",
"actorUserId": null,
"details": {
"eventId": "<id:1>",
"medicationId": "<id:2>"
},
"ipAddress": "unknown"
},
{
"action": "medication.intake.update",
"userId": "<id:3>",
"actorUserId": "<id:19>",
"details": {
"eventId": "<id:14>",
"medicationId": "<id:2>",
"fields": [
"takenAt"
],
"previous": {
"takenAt": "2026-10-13T20:15:00.000Z"
}
},
"ipAddress": null
},
{
"action": "medication.intake.update",
"userId": "<id:3>",
"actorUserId": null,
"details": {
"eventId": "<id:15>",
"medicationId": "<id:2>",
"fields": [
"scheduledFor",
"takenAt"
],
"previous": {
"scheduledFor": "2026-10-14T08:00:00.000Z",
"takenAt": "2026-10-14T08:10:00.000Z"
}
},
"ipAddress": null
},
{
"action": "medication.intake.update",
"userId": "<id:3>",
"actorUserId": null,
"details": {
"eventId": "<id:17>",
"medicationId": "<id:2>",
"fields": [
"scheduledFor",
"takenAt"
],
"previous": {
"scheduledFor": "2026-10-14T20:00:00.000Z",
"takenAt": "2026-10-14T20:30:00.000Z"
}
},
"ipAddress": null
},
{
"action": "medication.intake.update",
"userId": "<id:3>",
"actorUserId": null,
"details": {
"eventId": "<id:11>",
"medicationId": "<id:2>",
"fields": [
"scheduledFor"
],
"previous": {
"scheduledFor": "2026-10-12T20:00:00.000Z"
}
},
"ipAddress": null
},
{
"action": "medication.intake.update",
"userId": "<id:3>",
"actorUserId": null,
"details": {
"eventId": "<id:13>",
"medicationId": "<id:2>",
"fields": [
"scheduledFor"
],
"previous": {
"scheduledFor": "2026-10-13T20:00:00.000Z"
}
},
"ipAddress": null
},
{
"action": "medication.intake.update",
"userId": "<id:3>",
"actorUserId": null,
"details": {
"eventId": "<id:12>",
"medicationId": "<id:2>",
"fields": [
"skipped"
],
"previous": {
"skipped": false
}
},
"ipAddress": null
},
{
"action": "medication.intake.update",
"userId": "<id:3>",
"actorUserId": null,
"details": {
"eventId": "<id:12>",
"medicationId": "<id:2>",
"fields": [
"takenAt"
],
"previous": {
"takenAt": null
}
},
"ipAddress": null
}
],
"idempotency": []
}
}
@@ -0,0 +1,572 @@
{
"status": 200,
"body": {
"data": {
"deleted": true
},
"error": null
},
"events": [
{
"status": 200,
"action": {
"name": "medication.oneShot.reconciled"
},
"meta": {
"medication_id": "<id:1>",
"action": "activate"
},
"warnings": null,
"error": null
}
],
"effects": [
{
"effect": "queueMedicationIntakeSync",
"args": [
{
"userId": "<id:2>",
"originDeviceToken": null
}
]
}
],
"stored": {
"medications": [
{
"id": "<id:1>",
"userId": "<id:2>",
"name": "Parity one-shot",
"dose": "10mg",
"treatmentClass": "GENERIC",
"dosesPerUnit": null,
"unitsPerDose": "1",
"active": true,
"notificationsEnabled": true,
"pausedAt": null,
"snoozedUntil": null,
"startsOn": "2026-10-01T00:00:00.000Z",
"endsOn": null,
"oneShot": true,
"asNeeded": false,
"trackIntake": true,
"autoMarkTaken": false,
"autoMarkTakenSince": null,
"deliveryForm": "ORAL",
"trackInjectionSites": false,
"allowedInjectionSites": [],
"liveActivityEnabled": false,
"criticalAlarmEnabled": false,
"atcCode": null,
"rxNormCode": null,
"lowStockNotifiedAt": null,
"lowStockNotifiedThresholdDays": null,
"reorderLeadDays": null,
"externalSource": null,
"externalId": null,
"createdAt": "<createdAt>",
"updatedAt": "<updatedAt>"
},
{
"id": "<id:3>",
"userId": "<id:2>",
"name": "Parity tablet",
"dose": "10mg",
"treatmentClass": "GENERIC",
"dosesPerUnit": null,
"unitsPerDose": "1",
"active": true,
"notificationsEnabled": true,
"pausedAt": null,
"snoozedUntil": null,
"startsOn": "2026-10-01T00:00:00.000Z",
"endsOn": null,
"oneShot": false,
"asNeeded": false,
"trackIntake": true,
"autoMarkTaken": false,
"autoMarkTakenSince": null,
"deliveryForm": "ORAL",
"trackInjectionSites": false,
"allowedInjectionSites": [],
"liveActivityEnabled": false,
"criticalAlarmEnabled": false,
"atcCode": null,
"rxNormCode": null,
"lowStockNotifiedAt": null,
"lowStockNotifiedThresholdDays": null,
"reorderLeadDays": null,
"externalSource": null,
"externalId": null,
"createdAt": "<createdAt>",
"updatedAt": "<updatedAt>"
}
],
"schedules": [
{
"id": "<id:4>",
"medicationId": "<id:3>",
"windowStart": "08:00",
"windowEnd": "10:00",
"label": "Morning",
"dose": null,
"unitsPerDose": null,
"daysOfWeek": null,
"timesOfDay": [],
"reminderGraceMinutes": null,
"rrule": null,
"rollingIntervalDays": null,
"scheduleType": "SCHEDULED",
"cyclicOnWeeks": null,
"cyclicOffWeeks": null,
"doseWindows": null
},
{
"id": "<id:5>",
"medicationId": "<id:1>",
"windowStart": "09:00",
"windowEnd": "11:00",
"label": null,
"dose": null,
"unitsPerDose": null,
"daysOfWeek": null,
"timesOfDay": [],
"reminderGraceMinutes": null,
"rrule": null,
"rollingIntervalDays": null,
"scheduleType": "SCHEDULED",
"cyclicOnWeeks": null,
"cyclicOffWeeks": null,
"doseWindows": null
},
{
"id": "<id:6>",
"medicationId": "<id:3>",
"windowStart": "20:00",
"windowEnd": "22:00",
"label": "Evening",
"dose": null,
"unitsPerDose": null,
"daysOfWeek": null,
"timesOfDay": [],
"reminderGraceMinutes": null,
"rrule": null,
"rollingIntervalDays": null,
"scheduleType": "SCHEDULED",
"cyclicOnWeeks": null,
"cyclicOffWeeks": null,
"doseWindows": null
}
],
"revisions": [],
"pauseEras": [],
"courses": [],
"intakes": [
{
"id": "<id:7>",
"userId": "<id:2>",
"medicationId": "<id:1>",
"scheduledFor": "2026-10-10T09:00:00.000Z",
"takenAt": "2026-10-10T09:30:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "<now>"
},
{
"id": "<id:8>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-11T08:00:00.000Z",
"takenAt": "2026-10-11T08:20:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "<now>"
},
{
"id": "<id:9>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-11T20:00:00.000Z",
"takenAt": "2026-10-11T20:20:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:10>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-12T08:00:00.000Z",
"takenAt": "2026-10-12T08:05:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "2026-10-12T09:00:00.000Z"
},
{
"id": "<id:11>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-12T20:00:00.000Z",
"takenAt": "2026-10-13T20:15:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "USER_PIN",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "<now>"
},
{
"id": "<id:12>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-13T08:00:00.000Z",
"takenAt": "2026-10-13T08:40:00.000Z",
"skipped": true,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:13>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-13T20:00:00.000Z",
"takenAt": "2026-10-13T20:15:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "<now>"
},
{
"id": "<id:14>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-13T20:00:00.000Z",
"takenAt": "2026-10-13T20:50:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:15>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-14T08:00:00.000Z",
"takenAt": "2026-10-14T08:10:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "<now>"
},
{
"id": "<id:16>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-14T08:00:00.000Z",
"takenAt": "2026-10-14T08:45:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:17>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-14T20:00:00.000Z",
"takenAt": "2026-10-14T20:30:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "<now>"
}
],
"doseChanges": [],
"inventoryItems": [
{
"id": "<id:18>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"state": "IN_USE",
"containerType": "OTHER",
"unitsTotal": "30",
"unitsRemaining": "30",
"firstUseAt": "2026-10-13T08:40:00.000Z",
"expiresAt": null,
"printedExpiry": null,
"purchasedAt": "2026-10-01T06:00:00.000Z",
"manufacturer": null,
"doseStrength": null,
"notes": null,
"notesEncrypted": null,
"createdAt": "<createdAt>",
"updatedAt": "<updatedAt>"
}
],
"inventoryEvents": [],
"categories": [],
"ingredients": [],
"audit": [
{
"action": "medication.intake.delete",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"eventId": "<id:8>",
"medicationId": "<id:3>"
},
"ipAddress": "unknown"
},
{
"action": "medication.intake.delete",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"eventId": "<id:7>",
"medicationId": "<id:1>"
},
"ipAddress": "unknown"
},
{
"action": "medication.intake.update",
"userId": "<id:2>",
"actorUserId": "<id:19>",
"details": {
"eventId": "<id:14>",
"medicationId": "<id:3>",
"fields": [
"takenAt"
],
"previous": {
"takenAt": "2026-10-13T20:15:00.000Z"
}
},
"ipAddress": null
},
{
"action": "medication.intake.update",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"eventId": "<id:15>",
"medicationId": "<id:3>",
"fields": [
"scheduledFor",
"takenAt"
],
"previous": {
"scheduledFor": "2026-10-14T08:00:00.000Z",
"takenAt": "2026-10-14T08:10:00.000Z"
}
},
"ipAddress": null
},
{
"action": "medication.intake.update",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"eventId": "<id:17>",
"medicationId": "<id:3>",
"fields": [
"scheduledFor",
"takenAt"
],
"previous": {
"scheduledFor": "2026-10-14T20:00:00.000Z",
"takenAt": "2026-10-14T20:30:00.000Z"
}
},
"ipAddress": null
},
{
"action": "medication.intake.update",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"eventId": "<id:11>",
"medicationId": "<id:3>",
"fields": [
"scheduledFor"
],
"previous": {
"scheduledFor": "2026-10-12T20:00:00.000Z"
}
},
"ipAddress": null
},
{
"action": "medication.intake.update",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"eventId": "<id:13>",
"medicationId": "<id:3>",
"fields": [
"scheduledFor"
],
"previous": {
"scheduledFor": "2026-10-13T20:00:00.000Z"
}
},
"ipAddress": null
},
{
"action": "medication.intake.update",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"eventId": "<id:12>",
"medicationId": "<id:3>",
"fields": [
"skipped"
],
"previous": {
"skipped": false
}
},
"ipAddress": null
},
{
"action": "medication.intake.update",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"eventId": "<id:12>",
"medicationId": "<id:3>",
"fields": [
"takenAt"
],
"previous": {
"takenAt": null
}
},
"ipAddress": null
},
{
"action": "medication.oneShot.reconciled",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:1>",
"action": "activate"
},
"ipAddress": null
}
],
"idempotency": []
}
}
@@ -0,0 +1,559 @@
{
"status": 404,
"body": {
"data": null,
"error": "Intake not found",
"meta": {
"errorCode": "http.not_found",
"requestId": "<requestId>"
}
},
"events": [
{
"status": 404,
"action": null,
"meta": null,
"warnings": null,
"error": null
}
],
"effects": [],
"stored": {
"medications": [
{
"id": "<id:1>",
"userId": "<id:2>",
"name": "Parity one-shot",
"dose": "10mg",
"treatmentClass": "GENERIC",
"dosesPerUnit": null,
"unitsPerDose": "1",
"active": true,
"notificationsEnabled": true,
"pausedAt": null,
"snoozedUntil": null,
"startsOn": "2026-10-01T00:00:00.000Z",
"endsOn": null,
"oneShot": true,
"asNeeded": false,
"trackIntake": true,
"autoMarkTaken": false,
"autoMarkTakenSince": null,
"deliveryForm": "ORAL",
"trackInjectionSites": false,
"allowedInjectionSites": [],
"liveActivityEnabled": false,
"criticalAlarmEnabled": false,
"atcCode": null,
"rxNormCode": null,
"lowStockNotifiedAt": null,
"lowStockNotifiedThresholdDays": null,
"reorderLeadDays": null,
"externalSource": null,
"externalId": null,
"createdAt": "<createdAt>",
"updatedAt": "<updatedAt>"
},
{
"id": "<id:3>",
"userId": "<id:2>",
"name": "Parity tablet",
"dose": "10mg",
"treatmentClass": "GENERIC",
"dosesPerUnit": null,
"unitsPerDose": "1",
"active": true,
"notificationsEnabled": true,
"pausedAt": null,
"snoozedUntil": null,
"startsOn": "2026-10-01T00:00:00.000Z",
"endsOn": null,
"oneShot": false,
"asNeeded": false,
"trackIntake": true,
"autoMarkTaken": false,
"autoMarkTakenSince": null,
"deliveryForm": "ORAL",
"trackInjectionSites": false,
"allowedInjectionSites": [],
"liveActivityEnabled": false,
"criticalAlarmEnabled": false,
"atcCode": null,
"rxNormCode": null,
"lowStockNotifiedAt": null,
"lowStockNotifiedThresholdDays": null,
"reorderLeadDays": null,
"externalSource": null,
"externalId": null,
"createdAt": "<createdAt>",
"updatedAt": "<updatedAt>"
}
],
"schedules": [
{
"id": "<id:4>",
"medicationId": "<id:3>",
"windowStart": "08:00",
"windowEnd": "10:00",
"label": "Morning",
"dose": null,
"unitsPerDose": null,
"daysOfWeek": null,
"timesOfDay": [],
"reminderGraceMinutes": null,
"rrule": null,
"rollingIntervalDays": null,
"scheduleType": "SCHEDULED",
"cyclicOnWeeks": null,
"cyclicOffWeeks": null,
"doseWindows": null
},
{
"id": "<id:5>",
"medicationId": "<id:1>",
"windowStart": "09:00",
"windowEnd": "11:00",
"label": null,
"dose": null,
"unitsPerDose": null,
"daysOfWeek": null,
"timesOfDay": [],
"reminderGraceMinutes": null,
"rrule": null,
"rollingIntervalDays": null,
"scheduleType": "SCHEDULED",
"cyclicOnWeeks": null,
"cyclicOffWeeks": null,
"doseWindows": null
},
{
"id": "<id:6>",
"medicationId": "<id:3>",
"windowStart": "20:00",
"windowEnd": "22:00",
"label": "Evening",
"dose": null,
"unitsPerDose": null,
"daysOfWeek": null,
"timesOfDay": [],
"reminderGraceMinutes": null,
"rrule": null,
"rollingIntervalDays": null,
"scheduleType": "SCHEDULED",
"cyclicOnWeeks": null,
"cyclicOffWeeks": null,
"doseWindows": null
}
],
"revisions": [],
"pauseEras": [],
"courses": [],
"intakes": [
{
"id": "<id:7>",
"userId": "<id:2>",
"medicationId": "<id:1>",
"scheduledFor": "2026-10-10T09:00:00.000Z",
"takenAt": "2026-10-10T09:30:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "<now>"
},
{
"id": "<id:8>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-11T08:00:00.000Z",
"takenAt": "2026-10-11T08:20:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "<now>"
},
{
"id": "<id:9>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-11T20:00:00.000Z",
"takenAt": "2026-10-11T20:20:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:10>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-12T08:00:00.000Z",
"takenAt": "2026-10-12T08:05:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "2026-10-12T09:00:00.000Z"
},
{
"id": "<id:11>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-12T20:00:00.000Z",
"takenAt": "2026-10-13T20:15:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "USER_PIN",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "<now>"
},
{
"id": "<id:12>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-13T08:00:00.000Z",
"takenAt": "2026-10-13T08:40:00.000Z",
"skipped": true,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:13>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-13T20:00:00.000Z",
"takenAt": "2026-10-13T20:15:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "<now>"
},
{
"id": "<id:14>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-13T20:00:00.000Z",
"takenAt": "2026-10-13T20:50:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:15>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-14T08:00:00.000Z",
"takenAt": "2026-10-14T08:10:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "<now>"
},
{
"id": "<id:16>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-14T08:00:00.000Z",
"takenAt": "2026-10-14T08:45:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:17>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-14T20:00:00.000Z",
"takenAt": "2026-10-14T20:30:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "<now>"
}
],
"doseChanges": [],
"inventoryItems": [
{
"id": "<id:18>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"state": "IN_USE",
"containerType": "OTHER",
"unitsTotal": "30",
"unitsRemaining": "30",
"firstUseAt": "2026-10-13T08:40:00.000Z",
"expiresAt": null,
"printedExpiry": null,
"purchasedAt": "2026-10-01T06:00:00.000Z",
"manufacturer": null,
"doseStrength": null,
"notes": null,
"notesEncrypted": null,
"createdAt": "<createdAt>",
"updatedAt": "<updatedAt>"
}
],
"inventoryEvents": [],
"categories": [],
"ingredients": [],
"audit": [
{
"action": "medication.intake.delete",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"eventId": "<id:8>",
"medicationId": "<id:3>"
},
"ipAddress": "unknown"
},
{
"action": "medication.intake.delete",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"eventId": "<id:7>",
"medicationId": "<id:1>"
},
"ipAddress": "unknown"
},
{
"action": "medication.intake.update",
"userId": "<id:2>",
"actorUserId": "<id:19>",
"details": {
"eventId": "<id:14>",
"medicationId": "<id:3>",
"fields": [
"takenAt"
],
"previous": {
"takenAt": "2026-10-13T20:15:00.000Z"
}
},
"ipAddress": null
},
{
"action": "medication.intake.update",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"eventId": "<id:15>",
"medicationId": "<id:3>",
"fields": [
"scheduledFor",
"takenAt"
],
"previous": {
"scheduledFor": "2026-10-14T08:00:00.000Z",
"takenAt": "2026-10-14T08:10:00.000Z"
}
},
"ipAddress": null
},
{
"action": "medication.intake.update",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"eventId": "<id:17>",
"medicationId": "<id:3>",
"fields": [
"scheduledFor",
"takenAt"
],
"previous": {
"scheduledFor": "2026-10-14T20:00:00.000Z",
"takenAt": "2026-10-14T20:30:00.000Z"
}
},
"ipAddress": null
},
{
"action": "medication.intake.update",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"eventId": "<id:11>",
"medicationId": "<id:3>",
"fields": [
"scheduledFor"
],
"previous": {
"scheduledFor": "2026-10-12T20:00:00.000Z"
}
},
"ipAddress": null
},
{
"action": "medication.intake.update",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"eventId": "<id:13>",
"medicationId": "<id:3>",
"fields": [
"scheduledFor"
],
"previous": {
"scheduledFor": "2026-10-13T20:00:00.000Z"
}
},
"ipAddress": null
},
{
"action": "medication.intake.update",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"eventId": "<id:12>",
"medicationId": "<id:3>",
"fields": [
"skipped"
],
"previous": {
"skipped": false
}
},
"ipAddress": null
},
{
"action": "medication.intake.update",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"eventId": "<id:12>",
"medicationId": "<id:3>",
"fields": [
"takenAt"
],
"previous": {
"takenAt": null
}
},
"ipAddress": null
},
{
"action": "medication.oneShot.reconciled",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:1>",
"action": "activate"
},
"ipAddress": null
}
],
"idempotency": []
}
}
@@ -0,0 +1,564 @@
{
"status": 403,
"body": {
"data": null,
"error": "Account access denied",
"meta": {
"errorCode": "sharing.access.denied",
"requestId": "<requestId>"
}
},
"events": [
{
"status": 403,
"action": null,
"meta": {
"sharing_refusal": "insufficient_access"
},
"warnings": null,
"error": {
"type": "SharingAccessDeniedError",
"message": "Account access denied"
}
}
],
"effects": [],
"stored": {
"medications": [
{
"id": "<id:1>",
"userId": "<id:2>",
"name": "Parity one-shot",
"dose": "10mg",
"treatmentClass": "GENERIC",
"dosesPerUnit": null,
"unitsPerDose": "1",
"active": true,
"notificationsEnabled": true,
"pausedAt": null,
"snoozedUntil": null,
"startsOn": "2026-10-01T00:00:00.000Z",
"endsOn": null,
"oneShot": true,
"asNeeded": false,
"trackIntake": true,
"autoMarkTaken": false,
"autoMarkTakenSince": null,
"deliveryForm": "ORAL",
"trackInjectionSites": false,
"allowedInjectionSites": [],
"liveActivityEnabled": false,
"criticalAlarmEnabled": false,
"atcCode": null,
"rxNormCode": null,
"lowStockNotifiedAt": null,
"lowStockNotifiedThresholdDays": null,
"reorderLeadDays": null,
"externalSource": null,
"externalId": null,
"createdAt": "<createdAt>",
"updatedAt": "<updatedAt>"
},
{
"id": "<id:3>",
"userId": "<id:2>",
"name": "Parity tablet",
"dose": "10mg",
"treatmentClass": "GENERIC",
"dosesPerUnit": null,
"unitsPerDose": "1",
"active": true,
"notificationsEnabled": true,
"pausedAt": null,
"snoozedUntil": null,
"startsOn": "2026-10-01T00:00:00.000Z",
"endsOn": null,
"oneShot": false,
"asNeeded": false,
"trackIntake": true,
"autoMarkTaken": false,
"autoMarkTakenSince": null,
"deliveryForm": "ORAL",
"trackInjectionSites": false,
"allowedInjectionSites": [],
"liveActivityEnabled": false,
"criticalAlarmEnabled": false,
"atcCode": null,
"rxNormCode": null,
"lowStockNotifiedAt": null,
"lowStockNotifiedThresholdDays": null,
"reorderLeadDays": null,
"externalSource": null,
"externalId": null,
"createdAt": "<createdAt>",
"updatedAt": "<updatedAt>"
}
],
"schedules": [
{
"id": "<id:4>",
"medicationId": "<id:3>",
"windowStart": "08:00",
"windowEnd": "10:00",
"label": "Morning",
"dose": null,
"unitsPerDose": null,
"daysOfWeek": null,
"timesOfDay": [],
"reminderGraceMinutes": null,
"rrule": null,
"rollingIntervalDays": null,
"scheduleType": "SCHEDULED",
"cyclicOnWeeks": null,
"cyclicOffWeeks": null,
"doseWindows": null
},
{
"id": "<id:5>",
"medicationId": "<id:1>",
"windowStart": "09:00",
"windowEnd": "11:00",
"label": null,
"dose": null,
"unitsPerDose": null,
"daysOfWeek": null,
"timesOfDay": [],
"reminderGraceMinutes": null,
"rrule": null,
"rollingIntervalDays": null,
"scheduleType": "SCHEDULED",
"cyclicOnWeeks": null,
"cyclicOffWeeks": null,
"doseWindows": null
},
{
"id": "<id:6>",
"medicationId": "<id:3>",
"windowStart": "20:00",
"windowEnd": "22:00",
"label": "Evening",
"dose": null,
"unitsPerDose": null,
"daysOfWeek": null,
"timesOfDay": [],
"reminderGraceMinutes": null,
"rrule": null,
"rollingIntervalDays": null,
"scheduleType": "SCHEDULED",
"cyclicOnWeeks": null,
"cyclicOffWeeks": null,
"doseWindows": null
}
],
"revisions": [],
"pauseEras": [],
"courses": [],
"intakes": [
{
"id": "<id:7>",
"userId": "<id:2>",
"medicationId": "<id:1>",
"scheduledFor": "2026-10-10T09:00:00.000Z",
"takenAt": "2026-10-10T09:30:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "<now>"
},
{
"id": "<id:8>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-11T08:00:00.000Z",
"takenAt": "2026-10-11T08:20:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "<now>"
},
{
"id": "<id:9>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-11T20:00:00.000Z",
"takenAt": "2026-10-11T20:20:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:10>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-12T08:00:00.000Z",
"takenAt": "2026-10-12T08:05:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "2026-10-12T09:00:00.000Z"
},
{
"id": "<id:11>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-12T20:00:00.000Z",
"takenAt": "2026-10-13T20:15:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "USER_PIN",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "<now>"
},
{
"id": "<id:12>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-13T08:00:00.000Z",
"takenAt": "2026-10-13T08:40:00.000Z",
"skipped": true,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:13>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-13T20:00:00.000Z",
"takenAt": "2026-10-13T20:15:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "<now>"
},
{
"id": "<id:14>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-13T20:00:00.000Z",
"takenAt": "2026-10-13T20:50:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:15>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-14T08:00:00.000Z",
"takenAt": "2026-10-14T08:10:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "<now>"
},
{
"id": "<id:16>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-14T08:00:00.000Z",
"takenAt": "2026-10-14T08:45:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:17>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-14T20:00:00.000Z",
"takenAt": "2026-10-14T20:30:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "<now>"
}
],
"doseChanges": [],
"inventoryItems": [
{
"id": "<id:18>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"state": "IN_USE",
"containerType": "OTHER",
"unitsTotal": "30",
"unitsRemaining": "30",
"firstUseAt": "2026-10-13T08:40:00.000Z",
"expiresAt": null,
"printedExpiry": null,
"purchasedAt": "2026-10-01T06:00:00.000Z",
"manufacturer": null,
"doseStrength": null,
"notes": null,
"notesEncrypted": null,
"createdAt": "<createdAt>",
"updatedAt": "<updatedAt>"
}
],
"inventoryEvents": [],
"categories": [],
"ingredients": [],
"audit": [
{
"action": "medication.intake.delete",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"eventId": "<id:8>",
"medicationId": "<id:3>"
},
"ipAddress": "unknown"
},
{
"action": "medication.intake.delete",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"eventId": "<id:7>",
"medicationId": "<id:1>"
},
"ipAddress": "unknown"
},
{
"action": "medication.intake.update",
"userId": "<id:2>",
"actorUserId": "<id:19>",
"details": {
"eventId": "<id:14>",
"medicationId": "<id:3>",
"fields": [
"takenAt"
],
"previous": {
"takenAt": "2026-10-13T20:15:00.000Z"
}
},
"ipAddress": null
},
{
"action": "medication.intake.update",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"eventId": "<id:15>",
"medicationId": "<id:3>",
"fields": [
"scheduledFor",
"takenAt"
],
"previous": {
"scheduledFor": "2026-10-14T08:00:00.000Z",
"takenAt": "2026-10-14T08:10:00.000Z"
}
},
"ipAddress": null
},
{
"action": "medication.intake.update",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"eventId": "<id:17>",
"medicationId": "<id:3>",
"fields": [
"scheduledFor",
"takenAt"
],
"previous": {
"scheduledFor": "2026-10-14T20:00:00.000Z",
"takenAt": "2026-10-14T20:30:00.000Z"
}
},
"ipAddress": null
},
{
"action": "medication.intake.update",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"eventId": "<id:11>",
"medicationId": "<id:3>",
"fields": [
"scheduledFor"
],
"previous": {
"scheduledFor": "2026-10-12T20:00:00.000Z"
}
},
"ipAddress": null
},
{
"action": "medication.intake.update",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"eventId": "<id:13>",
"medicationId": "<id:3>",
"fields": [
"scheduledFor"
],
"previous": {
"scheduledFor": "2026-10-13T20:00:00.000Z"
}
},
"ipAddress": null
},
{
"action": "medication.intake.update",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"eventId": "<id:12>",
"medicationId": "<id:3>",
"fields": [
"skipped"
],
"previous": {
"skipped": false
}
},
"ipAddress": null
},
{
"action": "medication.intake.update",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"eventId": "<id:12>",
"medicationId": "<id:3>",
"fields": [
"takenAt"
],
"previous": {
"takenAt": null
}
},
"ipAddress": null
},
{
"action": "medication.oneShot.reconciled",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:1>",
"action": "activate"
},
"ipAddress": null
}
],
"idempotency": []
}
}
@@ -0,0 +1,583 @@
{
"status": 200,
"body": {
"data": {
"deleted": true
},
"error": null
},
"events": [
{
"status": 200,
"action": {
"name": "medication.intake.delete",
"entity_type": "intake_event",
"entity_id": "<id:1>"
},
"meta": {
"medication_id": "<id:2>"
},
"warnings": null,
"error": null
}
],
"effects": [
{
"effect": "queueMedicationIntakeSync",
"args": [
{
"userId": "<id:3>",
"originDeviceToken": null
}
]
}
],
"stored": {
"medications": [
{
"id": "<id:4>",
"userId": "<id:3>",
"name": "Parity one-shot",
"dose": "10mg",
"treatmentClass": "GENERIC",
"dosesPerUnit": null,
"unitsPerDose": "1",
"active": true,
"notificationsEnabled": true,
"pausedAt": null,
"snoozedUntil": null,
"startsOn": "2026-10-01T00:00:00.000Z",
"endsOn": null,
"oneShot": true,
"asNeeded": false,
"trackIntake": true,
"autoMarkTaken": false,
"autoMarkTakenSince": null,
"deliveryForm": "ORAL",
"trackInjectionSites": false,
"allowedInjectionSites": [],
"liveActivityEnabled": false,
"criticalAlarmEnabled": false,
"atcCode": null,
"rxNormCode": null,
"lowStockNotifiedAt": null,
"lowStockNotifiedThresholdDays": null,
"reorderLeadDays": null,
"externalSource": null,
"externalId": null,
"createdAt": "<createdAt>",
"updatedAt": "<updatedAt>"
},
{
"id": "<id:2>",
"userId": "<id:3>",
"name": "Parity tablet",
"dose": "10mg",
"treatmentClass": "GENERIC",
"dosesPerUnit": null,
"unitsPerDose": "1",
"active": true,
"notificationsEnabled": true,
"pausedAt": null,
"snoozedUntil": null,
"startsOn": "2026-10-01T00:00:00.000Z",
"endsOn": null,
"oneShot": false,
"asNeeded": false,
"trackIntake": true,
"autoMarkTaken": false,
"autoMarkTakenSince": null,
"deliveryForm": "ORAL",
"trackInjectionSites": false,
"allowedInjectionSites": [],
"liveActivityEnabled": false,
"criticalAlarmEnabled": false,
"atcCode": null,
"rxNormCode": null,
"lowStockNotifiedAt": null,
"lowStockNotifiedThresholdDays": null,
"reorderLeadDays": null,
"externalSource": null,
"externalId": null,
"createdAt": "<createdAt>",
"updatedAt": "<updatedAt>"
}
],
"schedules": [
{
"id": "<id:5>",
"medicationId": "<id:2>",
"windowStart": "08:00",
"windowEnd": "10:00",
"label": "Morning",
"dose": null,
"unitsPerDose": null,
"daysOfWeek": null,
"timesOfDay": [],
"reminderGraceMinutes": null,
"rrule": null,
"rollingIntervalDays": null,
"scheduleType": "SCHEDULED",
"cyclicOnWeeks": null,
"cyclicOffWeeks": null,
"doseWindows": null
},
{
"id": "<id:6>",
"medicationId": "<id:4>",
"windowStart": "09:00",
"windowEnd": "11:00",
"label": null,
"dose": null,
"unitsPerDose": null,
"daysOfWeek": null,
"timesOfDay": [],
"reminderGraceMinutes": null,
"rrule": null,
"rollingIntervalDays": null,
"scheduleType": "SCHEDULED",
"cyclicOnWeeks": null,
"cyclicOffWeeks": null,
"doseWindows": null
},
{
"id": "<id:7>",
"medicationId": "<id:2>",
"windowStart": "20:00",
"windowEnd": "22:00",
"label": "Evening",
"dose": null,
"unitsPerDose": null,
"daysOfWeek": null,
"timesOfDay": [],
"reminderGraceMinutes": null,
"rrule": null,
"rollingIntervalDays": null,
"scheduleType": "SCHEDULED",
"cyclicOnWeeks": null,
"cyclicOffWeeks": null,
"doseWindows": null
}
],
"revisions": [],
"pauseEras": [],
"courses": [],
"intakes": [
{
"id": "<id:8>",
"userId": "<id:3>",
"medicationId": "<id:4>",
"scheduledFor": "2026-10-10T09:00:00.000Z",
"takenAt": "2026-10-10T09:30:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "<now>"
},
{
"id": "<id:9>",
"userId": "<id:3>",
"medicationId": "<id:2>",
"scheduledFor": "2026-10-11T08:00:00.000Z",
"takenAt": "2026-10-11T08:20:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "<now>"
},
{
"id": "<id:1>",
"userId": "<id:3>",
"medicationId": "<id:2>",
"scheduledFor": "2026-10-11T20:00:00.000Z",
"takenAt": "2026-10-11T20:20:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "<now>"
},
{
"id": "<id:10>",
"userId": "<id:3>",
"medicationId": "<id:2>",
"scheduledFor": "2026-10-12T08:00:00.000Z",
"takenAt": "2026-10-12T08:05:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "2026-10-12T09:00:00.000Z"
},
{
"id": "<id:11>",
"userId": "<id:3>",
"medicationId": "<id:2>",
"scheduledFor": "2026-10-12T20:00:00.000Z",
"takenAt": "2026-10-13T20:15:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "USER_PIN",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "<now>"
},
{
"id": "<id:12>",
"userId": "<id:3>",
"medicationId": "<id:2>",
"scheduledFor": "2026-10-13T08:00:00.000Z",
"takenAt": "2026-10-13T08:40:00.000Z",
"skipped": true,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:13>",
"userId": "<id:3>",
"medicationId": "<id:2>",
"scheduledFor": "2026-10-13T20:00:00.000Z",
"takenAt": "2026-10-13T20:15:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "<now>"
},
{
"id": "<id:14>",
"userId": "<id:3>",
"medicationId": "<id:2>",
"scheduledFor": "2026-10-13T20:00:00.000Z",
"takenAt": "2026-10-13T20:50:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:15>",
"userId": "<id:3>",
"medicationId": "<id:2>",
"scheduledFor": "2026-10-14T08:00:00.000Z",
"takenAt": "2026-10-14T08:10:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "<now>"
},
{
"id": "<id:16>",
"userId": "<id:3>",
"medicationId": "<id:2>",
"scheduledFor": "2026-10-14T08:00:00.000Z",
"takenAt": "2026-10-14T08:45:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:17>",
"userId": "<id:3>",
"medicationId": "<id:2>",
"scheduledFor": "2026-10-14T20:00:00.000Z",
"takenAt": "2026-10-14T20:30:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "<now>"
}
],
"doseChanges": [],
"inventoryItems": [
{
"id": "<id:18>",
"userId": "<id:3>",
"medicationId": "<id:2>",
"state": "IN_USE",
"containerType": "OTHER",
"unitsTotal": "30",
"unitsRemaining": "30",
"firstUseAt": "2026-10-13T08:40:00.000Z",
"expiresAt": null,
"printedExpiry": null,
"purchasedAt": "2026-10-01T06:00:00.000Z",
"manufacturer": null,
"doseStrength": null,
"notes": null,
"notesEncrypted": null,
"createdAt": "<createdAt>",
"updatedAt": "<updatedAt>"
}
],
"inventoryEvents": [],
"categories": [],
"ingredients": [],
"audit": [
{
"action": "medication.intake.delete",
"userId": "<id:3>",
"actorUserId": "<id:19>",
"details": {
"eventId": "<id:1>",
"medicationId": "<id:2>"
},
"ipAddress": "unknown"
},
{
"action": "medication.intake.delete",
"userId": "<id:3>",
"actorUserId": null,
"details": {
"eventId": "<id:9>",
"medicationId": "<id:2>"
},
"ipAddress": "unknown"
},
{
"action": "medication.intake.delete",
"userId": "<id:3>",
"actorUserId": null,
"details": {
"eventId": "<id:8>",
"medicationId": "<id:4>"
},
"ipAddress": "unknown"
},
{
"action": "medication.intake.update",
"userId": "<id:3>",
"actorUserId": "<id:19>",
"details": {
"eventId": "<id:14>",
"medicationId": "<id:2>",
"fields": [
"takenAt"
],
"previous": {
"takenAt": "2026-10-13T20:15:00.000Z"
}
},
"ipAddress": null
},
{
"action": "medication.intake.update",
"userId": "<id:3>",
"actorUserId": null,
"details": {
"eventId": "<id:15>",
"medicationId": "<id:2>",
"fields": [
"scheduledFor",
"takenAt"
],
"previous": {
"scheduledFor": "2026-10-14T08:00:00.000Z",
"takenAt": "2026-10-14T08:10:00.000Z"
}
},
"ipAddress": null
},
{
"action": "medication.intake.update",
"userId": "<id:3>",
"actorUserId": null,
"details": {
"eventId": "<id:17>",
"medicationId": "<id:2>",
"fields": [
"scheduledFor",
"takenAt"
],
"previous": {
"scheduledFor": "2026-10-14T20:00:00.000Z",
"takenAt": "2026-10-14T20:30:00.000Z"
}
},
"ipAddress": null
},
{
"action": "medication.intake.update",
"userId": "<id:3>",
"actorUserId": null,
"details": {
"eventId": "<id:11>",
"medicationId": "<id:2>",
"fields": [
"scheduledFor"
],
"previous": {
"scheduledFor": "2026-10-12T20:00:00.000Z"
}
},
"ipAddress": null
},
{
"action": "medication.intake.update",
"userId": "<id:3>",
"actorUserId": null,
"details": {
"eventId": "<id:13>",
"medicationId": "<id:2>",
"fields": [
"scheduledFor"
],
"previous": {
"scheduledFor": "2026-10-13T20:00:00.000Z"
}
},
"ipAddress": null
},
{
"action": "medication.intake.update",
"userId": "<id:3>",
"actorUserId": null,
"details": {
"eventId": "<id:12>",
"medicationId": "<id:2>",
"fields": [
"skipped"
],
"previous": {
"skipped": false
}
},
"ipAddress": null
},
{
"action": "medication.intake.update",
"userId": "<id:3>",
"actorUserId": null,
"details": {
"eventId": "<id:12>",
"medicationId": "<id:2>",
"fields": [
"takenAt"
],
"previous": {
"takenAt": null
}
},
"ipAddress": null
},
{
"action": "medication.oneShot.reconciled",
"userId": "<id:3>",
"actorUserId": null,
"details": {
"medicationId": "<id:4>",
"action": "activate"
},
"ipAddress": null
}
],
"idempotency": []
}
}
@@ -0,0 +1,572 @@
{
"status": 401,
"body": {
"data": null,
"error": "Not authenticated",
"meta": {
"errorCode": "auth.missing",
"requestId": "<requestId>"
}
},
"events": [
{
"status": 401,
"action": null,
"meta": null,
"warnings": null,
"error": {
"type": "HttpError",
"message": "Not authenticated"
}
}
],
"effects": [],
"stored": {
"medications": [
{
"id": "<id:1>",
"userId": "<id:2>",
"name": "Parity one-shot",
"dose": "10mg",
"treatmentClass": "GENERIC",
"dosesPerUnit": null,
"unitsPerDose": "1",
"active": true,
"notificationsEnabled": true,
"pausedAt": null,
"snoozedUntil": null,
"startsOn": "2026-10-01T00:00:00.000Z",
"endsOn": null,
"oneShot": true,
"asNeeded": false,
"trackIntake": true,
"autoMarkTaken": false,
"autoMarkTakenSince": null,
"deliveryForm": "ORAL",
"trackInjectionSites": false,
"allowedInjectionSites": [],
"liveActivityEnabled": false,
"criticalAlarmEnabled": false,
"atcCode": null,
"rxNormCode": null,
"lowStockNotifiedAt": null,
"lowStockNotifiedThresholdDays": null,
"reorderLeadDays": null,
"externalSource": null,
"externalId": null,
"createdAt": "<createdAt>",
"updatedAt": "<updatedAt>"
},
{
"id": "<id:3>",
"userId": "<id:2>",
"name": "Parity tablet",
"dose": "10mg",
"treatmentClass": "GENERIC",
"dosesPerUnit": null,
"unitsPerDose": "1",
"active": true,
"notificationsEnabled": true,
"pausedAt": null,
"snoozedUntil": null,
"startsOn": "2026-10-01T00:00:00.000Z",
"endsOn": null,
"oneShot": false,
"asNeeded": false,
"trackIntake": true,
"autoMarkTaken": false,
"autoMarkTakenSince": null,
"deliveryForm": "ORAL",
"trackInjectionSites": false,
"allowedInjectionSites": [],
"liveActivityEnabled": false,
"criticalAlarmEnabled": false,
"atcCode": null,
"rxNormCode": null,
"lowStockNotifiedAt": null,
"lowStockNotifiedThresholdDays": null,
"reorderLeadDays": null,
"externalSource": null,
"externalId": null,
"createdAt": "<createdAt>",
"updatedAt": "<updatedAt>"
}
],
"schedules": [
{
"id": "<id:4>",
"medicationId": "<id:3>",
"windowStart": "08:00",
"windowEnd": "10:00",
"label": "Morning",
"dose": null,
"unitsPerDose": null,
"daysOfWeek": null,
"timesOfDay": [],
"reminderGraceMinutes": null,
"rrule": null,
"rollingIntervalDays": null,
"scheduleType": "SCHEDULED",
"cyclicOnWeeks": null,
"cyclicOffWeeks": null,
"doseWindows": null
},
{
"id": "<id:5>",
"medicationId": "<id:1>",
"windowStart": "09:00",
"windowEnd": "11:00",
"label": null,
"dose": null,
"unitsPerDose": null,
"daysOfWeek": null,
"timesOfDay": [],
"reminderGraceMinutes": null,
"rrule": null,
"rollingIntervalDays": null,
"scheduleType": "SCHEDULED",
"cyclicOnWeeks": null,
"cyclicOffWeeks": null,
"doseWindows": null
},
{
"id": "<id:6>",
"medicationId": "<id:3>",
"windowStart": "20:00",
"windowEnd": "22:00",
"label": "Evening",
"dose": null,
"unitsPerDose": null,
"daysOfWeek": null,
"timesOfDay": [],
"reminderGraceMinutes": null,
"rrule": null,
"rollingIntervalDays": null,
"scheduleType": "SCHEDULED",
"cyclicOnWeeks": null,
"cyclicOffWeeks": null,
"doseWindows": null
}
],
"revisions": [],
"pauseEras": [],
"courses": [],
"intakes": [
{
"id": "<id:7>",
"userId": "<id:2>",
"medicationId": "<id:1>",
"scheduledFor": "2026-10-10T09:00:00.000Z",
"takenAt": "2026-10-10T09:30:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "<now>"
},
{
"id": "<id:8>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-11T08:00:00.000Z",
"takenAt": "2026-10-11T08:20:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "<now>"
},
{
"id": "<id:9>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-11T20:00:00.000Z",
"takenAt": "2026-10-11T20:20:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "<now>"
},
{
"id": "<id:10>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-12T08:00:00.000Z",
"takenAt": "2026-10-12T08:05:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "2026-10-12T09:00:00.000Z"
},
{
"id": "<id:11>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-12T20:00:00.000Z",
"takenAt": "2026-10-13T20:15:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "USER_PIN",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "<now>"
},
{
"id": "<id:12>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-13T08:00:00.000Z",
"takenAt": "2026-10-13T08:40:00.000Z",
"skipped": true,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:13>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-13T20:00:00.000Z",
"takenAt": "2026-10-13T20:15:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "<now>"
},
{
"id": "<id:14>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-13T20:00:00.000Z",
"takenAt": "2026-10-13T20:50:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:15>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-14T08:00:00.000Z",
"takenAt": "2026-10-14T08:10:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "<now>"
},
{
"id": "<id:16>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-14T08:00:00.000Z",
"takenAt": "2026-10-14T08:45:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": null
},
{
"id": "<id:17>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"scheduledFor": "2026-10-14T20:00:00.000Z",
"takenAt": "2026-10-14T20:30:00.000Z",
"skipped": false,
"autoMissed": false,
"autoRecorded": false,
"attributionSource": "AUTO",
"source": "WEB",
"idempotencyKey": null,
"createdAt": "<createdAt>",
"injectionSite": null,
"doseTaken": null,
"inventoryConsumption": null,
"externalId": null,
"updatedAt": "<updatedAt>",
"syncVersion": "<syncVersion>",
"deletedAt": "<now>"
}
],
"doseChanges": [],
"inventoryItems": [
{
"id": "<id:18>",
"userId": "<id:2>",
"medicationId": "<id:3>",
"state": "IN_USE",
"containerType": "OTHER",
"unitsTotal": "30",
"unitsRemaining": "30",
"firstUseAt": "2026-10-13T08:40:00.000Z",
"expiresAt": null,
"printedExpiry": null,
"purchasedAt": "2026-10-01T06:00:00.000Z",
"manufacturer": null,
"doseStrength": null,
"notes": null,
"notesEncrypted": null,
"createdAt": "<createdAt>",
"updatedAt": "<updatedAt>"
}
],
"inventoryEvents": [],
"categories": [],
"ingredients": [],
"audit": [
{
"action": "medication.intake.delete",
"userId": "<id:2>",
"actorUserId": "<id:19>",
"details": {
"eventId": "<id:9>",
"medicationId": "<id:3>"
},
"ipAddress": "unknown"
},
{
"action": "medication.intake.delete",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"eventId": "<id:8>",
"medicationId": "<id:3>"
},
"ipAddress": "unknown"
},
{
"action": "medication.intake.delete",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"eventId": "<id:7>",
"medicationId": "<id:1>"
},
"ipAddress": "unknown"
},
{
"action": "medication.intake.update",
"userId": "<id:2>",
"actorUserId": "<id:19>",
"details": {
"eventId": "<id:14>",
"medicationId": "<id:3>",
"fields": [
"takenAt"
],
"previous": {
"takenAt": "2026-10-13T20:15:00.000Z"
}
},
"ipAddress": null
},
{
"action": "medication.intake.update",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"eventId": "<id:15>",
"medicationId": "<id:3>",
"fields": [
"scheduledFor",
"takenAt"
],
"previous": {
"scheduledFor": "2026-10-14T08:00:00.000Z",
"takenAt": "2026-10-14T08:10:00.000Z"
}
},
"ipAddress": null
},
{
"action": "medication.intake.update",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"eventId": "<id:17>",
"medicationId": "<id:3>",
"fields": [
"scheduledFor",
"takenAt"
],
"previous": {
"scheduledFor": "2026-10-14T20:00:00.000Z",
"takenAt": "2026-10-14T20:30:00.000Z"
}
},
"ipAddress": null
},
{
"action": "medication.intake.update",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"eventId": "<id:11>",
"medicationId": "<id:3>",
"fields": [
"scheduledFor"
],
"previous": {
"scheduledFor": "2026-10-12T20:00:00.000Z"
}
},
"ipAddress": null
},
{
"action": "medication.intake.update",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"eventId": "<id:13>",
"medicationId": "<id:3>",
"fields": [
"scheduledFor"
],
"previous": {
"scheduledFor": "2026-10-13T20:00:00.000Z"
}
},
"ipAddress": null
},
{
"action": "medication.intake.update",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"eventId": "<id:12>",
"medicationId": "<id:3>",
"fields": [
"skipped"
],
"previous": {
"skipped": false
}
},
"ipAddress": null
},
{
"action": "medication.intake.update",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"eventId": "<id:12>",
"medicationId": "<id:3>",
"fields": [
"takenAt"
],
"previous": {
"takenAt": null
}
},
"ipAddress": null
},
{
"action": "medication.oneShot.reconciled",
"userId": "<id:2>",
"actorUserId": null,
"details": {
"medicationId": "<id:1>",
"action": "activate"
},
"ipAddress": null
}
],
"idempotency": []
}
}
@@ -0,0 +1,384 @@
/**
* Parity for `PUT` and `DELETE /api/medications/{id}/intake/{eventId}` while
* the dose correction moves into `src/lib/medications/`.
*
* One record walks through the corrections the route tells apart, in order,
* each request seeing what the earlier ones stored: a take recorded in place,
* a take flipped to a skip, a correction that moves the dose to another slot
* (tombstone and converge), a pin onto a free slot, the two pin refusals, an
* unpin, an explicit slot, a take before the start day, a body the schema
* refuses, the not-found answers, and the same correction from a delegate who
* may only write and one who may manage. Then the deletes: the owner's, one
* that reactivates a one-shot medication, the not-found answer, and both
* delegates again. After each request the snapshot holds the response, the
* wide event, the recorded tails and every medication row of the accounts.
*
* The clock is pinned (`Date` only), so the snapshot is the same on every
* day it runs.
*/
import { afterAll, beforeAll, describe, it, vi } from "vitest";
import { DELETE, PUT } from "@/app/api/medications/[id]/intake/[eventId]/route";
import { anonymous, type RouteAuth } from "../../../kit/call-route";
import { makeMedication, makeSession, makeUser } from "../../../kit/factories";
import { getPrismaClient, truncateAllTables } from "../../setup";
import { delegateOf, parityStep } from "./medication-state";
vi.mock("@/lib/logging/transports", async (importOriginal) => {
const actual =
await importOriginal<typeof import("@/lib/logging/transports")>();
const { wideEventRecorder: recorder } = await import("../../../kit/parity");
return {
...actual,
emitIfSampled: (event: (typeof recorder.events)[number]) => {
recorder.events.push(event);
},
};
});
// The cross-device push the route queues on a timer, recorded instead of run
// (see `effectRecorder`).
vi.mock(
"@/lib/notifications/medication-intake-sync",
async (importOriginal) => {
const actual =
await importOriginal<
typeof import("@/lib/notifications/medication-intake-sync")
>();
const { effectRecorder } = await import("../../../kit/parity");
return {
...actual,
queueMedicationIntakeSync: (...args: unknown[]) => {
effectRecorder.record("queueMedicationIntakeSync", args);
},
};
},
);
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[];
let owner: RouteAuth;
let writer: { auth: RouteAuth; headers: Record<string, string> };
let manager: { auth: RouteAuth; headers: Record<string, string> };
let medicationId: string;
let oneShotId: string;
const events: Record<string, string> = {};
async function put(
name: string,
eventId: string,
body: unknown,
options: {
auth?: RouteAuth;
headers?: Record<string, string>;
medicationId?: string;
contract?: { skip: string };
} = {},
) {
return parityStep({
name: `medication-intake-event.${name}`,
handler: PUT,
options: {
method: "PUT",
route: ROUTE,
params: { id: options.medicationId ?? medicationId, eventId },
body,
auth: options.auth ?? owner,
headers: options.headers,
contract: options.contract,
},
userIds,
now: NOW,
});
}
async function del(
name: string,
eventId: string,
options: {
auth?: RouteAuth;
headers?: Record<string, string>;
medicationId?: string;
} = {},
) {
return parityStep({
name: `medication-intake-event.${name}`,
handler: DELETE,
options: {
method: "DELETE",
route: ROUTE,
params: { id: options.medicationId ?? medicationId, eventId },
auth: options.auth ?? owner,
headers: options.headers,
},
userIds,
now: NOW,
});
}
async function intake(
medication: string,
key: string,
data: {
scheduledFor: string;
takenAt?: string | null;
skipped?: boolean;
deletedAt?: string;
},
) {
const row = await prisma.medicationIntakeEvent.create({
data: {
userId: ownerId,
medicationId: medication,
scheduledFor: new Date(data.scheduledFor),
takenAt: data.takenAt ? new Date(data.takenAt) : null,
skipped: data.skipped ?? false,
deletedAt: data.deletedAt ? new Date(data.deletedAt) : null,
},
});
events[key] = row.id;
}
beforeAll(async () => {
vi.useFakeTimers({ toFake: ["Date"], now: NOW });
await truncateAllTables(prisma);
const user = await makeUser({ timezone: "UTC" });
ownerId = user.id;
owner = await makeSession(user);
const created = new Date("2026-10-01T06:00:00.000Z");
const medication = await makeMedication(
user,
{
name: "Parity tablet",
startsOn: new Date("2026-10-01"),
createdAt: created,
unitsPerDose: 1,
},
[
{ windowStart: "08:00", windowEnd: "10:00", label: "Morning" },
{ windowStart: "20:00", windowEnd: "22:00", label: "Evening" },
],
);
medicationId = medication.id;
await prisma.medicationInventoryItem.create({
data: {
userId: ownerId,
medicationId,
unitsTotal: 30,
unitsRemaining: 30,
purchasedAt: created,
},
});
const oneShot = await makeMedication(
user,
{
name: "Parity one-shot",
startsOn: new Date("2026-10-01"),
createdAt: created,
oneShot: true,
active: false,
},
[{ windowStart: "09:00", windowEnd: "11:00" }],
);
oneShotId = oneShot.id;
await intake(medicationId, "pending", {
scheduledFor: "2026-10-13T08:00:00.000Z",
});
await intake(medicationId, "legacyTaken", {
scheduledFor: "2026-10-13T20:00:00.000Z",
takenAt: "2026-10-13T20:15:00.000Z",
});
await intake(medicationId, "morningTaken", {
scheduledFor: "2026-10-14T08:00:00.000Z",
takenAt: "2026-10-14T08:10:00.000Z",
});
await intake(medicationId, "eveningSkipped", {
scheduledFor: "2026-10-14T20:00:00.000Z",
skipped: true,
});
await intake(medicationId, "tombstoned", {
scheduledFor: "2026-10-12T08:00:00.000Z",
takenAt: "2026-10-12T08:05:00.000Z",
deletedAt: "2026-10-12T09:00:00.000Z",
});
await intake(medicationId, "forDelete", {
scheduledFor: "2026-10-11T08:00:00.000Z",
takenAt: "2026-10-11T08:20:00.000Z",
});
await intake(medicationId, "forManagerDelete", {
scheduledFor: "2026-10-11T20:00:00.000Z",
takenAt: "2026-10-11T20:20:00.000Z",
});
await intake(oneShotId, "oneShotDose", {
scheduledFor: "2026-10-10T09:00:00.000Z",
takenAt: "2026-10-10T09:30:00.000Z",
});
const w = await delegateOf(prisma, user, "WRITE");
const m = await delegateOf(prisma, user, "MANAGE");
writer = { auth: w.auth, headers: w.headers };
manager = { auth: m.auth, headers: m.headers };
userIds = [ownerId, w.delegate.id, m.delegate.id];
});
afterAll(() => {
vi.useRealTimers();
});
describe("PUT /api/medications/{id}/intake/{eventId} parity", () => {
it("01 a pending dose taken inside its own window", async () => {
await put("01-take-in-place", events.pending, {
takenAt: "2026-10-13T08:40:00.000Z",
});
});
it("02 the same dose flipped to a skip", async () => {
await put("02-skip-flip", events.pending, { skipped: true });
});
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 },
);
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 },
);
events.pinned = (res.data as { id: string }).id;
});
it("05 a pin onto an instant that is no slot", async () => {
await put("05-pin-not-a-slot", events.moved, {
forceSlotInstant: "2026-10-12T15:00:00.000Z",
});
});
it("06 a pin onto a slot another dose holds", async () => {
await put("06-pin-occupied", events.moved, {
forceSlotInstant: "2026-10-12T20:00:00.000Z",
});
});
it("07 an unpin", async () => {
const res = await put(
"07-unpin",
events.pinned,
{ forceSlotInstant: null },
{ contract: SLOT_MOVE_ANSWER },
);
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 },
);
events.moved = (res.data as { id: string }).id;
});
it("09 a take before the start day", async () => {
await put("09-before-start", events.pinned, {
takenAt: "2026-09-20T08:00:00.000Z",
});
});
it("10 a body the schema refuses", async () => {
await put("10-invalid", events.pinned, {
takenAt: "yesterday",
skipped: "no",
});
});
it("11 a tombstoned dose, and a dose under another medication", async () => {
await put("11a-tombstoned", events.tombstoned, { skipped: true });
await put(
"11b-other-medication",
events.pinned,
{ skipped: true },
{ medicationId: oneShotId },
);
});
it("12 a delegate who may write, and one who may manage", async () => {
await put(
"12a-writer",
events.pinned,
{ takenAt: "2026-10-13T20:50:00.000Z" },
writer,
);
await put(
"12b-manager",
events.pinned,
{ takenAt: "2026-10-13T20:50:00.000Z" },
manager,
);
});
it("13 no credentials", async () => {
await put(
"13-anonymous",
events.pinned,
{ skipped: true },
{
auth: anonymous,
},
);
});
});
describe("DELETE /api/medications/{id}/intake/{eventId} parity", () => {
it("21 the owner undoes a dose", async () => {
await del("21-delete", events.forDelete);
});
it("22 undoing the only dose of a one-shot medication", async () => {
await del("22-delete-one-shot", events.oneShotDose, {
medicationId: oneShotId,
});
});
it("23 a dose under another medication", async () => {
await del("23-other-medication", events.forManagerDelete, {
medicationId: oneShotId,
});
});
it("24 a delegate who may write, and one who may manage", async () => {
await del("24a-writer", events.forManagerDelete, writer);
await del("24b-manager", events.forManagerDelete, manager);
});
it("25 no credentials", async () => {
await del("25-anonymous", events.forDelete, { auth: anonymous });
});
});
@@ -0,0 +1,226 @@
/**
* What a medication route leaves in the database, read back for a parity
* snapshot (see `tests/kit/parity.ts`).
*
* Whole rows, not a hand-picked select: a parity snapshot is meant to notice
* a column the moved code stops writing, and a select names only the columns
* somebody thought of. Two kinds of value are rewritten before the snapshot
* sees them, because their bytes differ between two runs of the same code:
* ciphertext (a fresh IV per write) reads as `<bytes>` or `<ciphertext>`, and
* a Prisma `Decimal` reads as its decimal string.
*
* Rows come back in an order decided by their content with generated ids
* blanked, never by the ids themselves, so two runs list them alike.
*/
import { Prisma, type User } from "@/generated/prisma/client";
import type { AccountGrantAccess } from "@/generated/prisma/enums";
import { expect } from "vitest";
import { callRoute, type CallRouteOptions } from "../../../kit/call-route";
import type { SessionFixture } from "../../../kit/factories";
import { makeGrant, makeSession, makeUser } from "../../../kit/factories";
import {
effectRecorder,
eventFacts,
expectParity,
stable,
wideEventRecorder,
} from "../../../kit/parity";
import { getPrismaClient } from "../../setup";
type Client = ReturnType<typeof getPrismaClient>;
/**
* A second account holding a grant of `access` over `owner`'s record, with
* its session switched onto that record and the headers a switched browser
* sends with every request.
*/
export async function delegateOf(
prisma: Client,
owner: Pick<User, "id">,
access: AccountGrantAccess,
): Promise<{
delegate: User;
auth: SessionFixture;
headers: Record<string, string>;
}> {
const delegate = await makeUser({ timezone: "UTC" });
await makeGrant(owner, delegate, { access });
const auth = await makeSession(delegate);
const switched = await prisma.session.update({
where: { id: auth.sessionId },
data: { actingAsUserId: owner.id },
});
return {
delegate,
auth,
headers: {
"x-healthlog-record-epoch": String(switched.recordEpoch),
"x-healthlog-record-scope": owner.id,
},
};
}
const GENERATED_ID =
/^(c[a-z0-9]{24}|[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})$/;
/** Audit rows the record guard writes without awaiting them. */
const GUARD_TRAIL_ACTIONS = [
"sharing.record.accessed",
"sharing.access.denied",
] as const;
const ORDER_BLIND_KEYS = new Set(["createdAt", "updatedAt", "syncVersion"]);
/** A copy with ciphertext and decimals replaced by stable stand-ins. */
export function plain(value: unknown): unknown {
if (value === null || value === undefined) return value;
if (value instanceof Date) return value;
if (Prisma.Decimal.isDecimal(value)) return value.toString();
if (value instanceof Uint8Array) return "<bytes>";
if (Array.isArray(value)) return value.map(plain);
if (typeof value === "object") {
const out: Record<string, unknown> = {};
for (const [k, v] of Object.entries(value)) {
out[k] = /Encrypted$/.test(k) && v !== null ? "<ciphertext>" : plain(v);
}
return out;
}
return value;
}
function orderKey(value: unknown): string {
return JSON.stringify(value, (key, v: unknown) => {
if (ORDER_BLIND_KEYS.has(key)) return undefined;
if (typeof v === "string" && GENERATED_ID.test(v)) return "";
return v;
});
}
/** Rows in content order, ids and stamps left out of the comparison. */
export function sortRows<T>(rows: readonly T[]): unknown[] {
return rows
.map(plain)
.map((row) => ({ row, key: orderKey(row) }))
.sort((a, b) => (a.key < b.key ? -1 : a.key > b.key ? 1 : 0))
.map(({ row }) => row);
}
/**
* Every medication table a medication route writes, for the given accounts,
* plus the audit trail and the idempotency cache. The rows the record guard
* writes about a delegate (the day's access row, a refusal) are left out: the
* guard writes them fire-and-forget, so whether one has landed when the test
* reads is a race, not something the route decides.
*/
export async function medicationState(prisma: Client, userIds: string[]) {
const byUser = { userId: { in: userIds } };
const byMedication = { medication: byUser };
const [
medications,
schedules,
revisions,
pauseEras,
courses,
intakes,
doseChanges,
inventoryItems,
inventoryEvents,
categories,
ingredients,
audit,
idempotency,
] = await Promise.all([
prisma.medication.findMany({ where: byUser }),
prisma.medicationSchedule.findMany({ where: byMedication }),
prisma.medicationScheduleRevision.findMany({ where: byMedication }),
prisma.medicationPauseEra.findMany({ where: byMedication }),
prisma.medicationCourse.findMany({ where: byMedication }),
prisma.medicationIntakeEvent.findMany({ where: byUser }),
prisma.medicationDoseChange.findMany({ where: byMedication }),
prisma.medicationInventoryItem.findMany({ where: byUser }),
prisma.medicationInventoryEvent.findMany({ where: byMedication }),
prisma.medicationCategoryAssignment.findMany({ where: byMedication }),
prisma.medicationIngredient.findMany({ where: byMedication }),
prisma.auditLog.findMany({
where: { ...byUser, action: { notIn: [...GUARD_TRAIL_ACTIONS] } },
select: {
action: true,
userId: true,
actorUserId: true,
details: true,
ipAddress: true,
},
}),
prisma.idempotencyKey.findMany({
where: byUser,
select: {
userId: true,
key: true,
method: true,
path: true,
responseStatus: true,
requestFingerprint: true,
expiresAt: true,
},
}),
]);
return {
medications: sortRows(medications),
schedules: sortRows(schedules),
revisions: sortRows(revisions),
pauseEras: sortRows(pauseEras),
courses: sortRows(courses),
intakes: sortRows(intakes),
doseChanges: sortRows(doseChanges),
inventoryItems: sortRows(inventoryItems),
inventoryEvents: sortRows(inventoryEvents),
categories: sortRows(categories),
ingredients: sortRows(ingredients),
audit: sortRows(
audit.map((row) => ({
...row,
details: row.details ? (JSON.parse(row.details) as unknown) : null,
})),
),
idempotency: sortRows(idempotency),
};
}
export interface ParityCall {
/** Snapshot name, `<route>.<case>`. */
name: string;
handler: Parameters<typeof callRoute>[0];
options: CallRouteOptions;
/** Accounts whose rows the snapshot reads back. */
userIds: string[];
/** The clock the test pinned; server stamps at or after it read `<now>`. */
now: Date;
}
/**
* One request and everything it decided: the response, the wide event, the
* recorded tails and the rows read back afterwards, compared with the
* committed snapshot. Returns the response for a test that needs an id from
* it for the next case.
*/
export async function parityStep(call: ParityCall) {
wideEventRecorder.take();
effectRecorder.take();
const res = await callRoute(call.handler, call.options);
const events = wideEventRecorder.take();
expect(events.length).toBeGreaterThan(0);
await expectParity(
call.name,
stable(
{
status: res.status,
body: res.body,
events: events.map(eventFacts),
effects: effectRecorder.take(),
stored: await medicationState(getPrismaClient(), call.userIds),
},
{ since: call.now },
),
);
return res;
}