End-to-end test
Walk this sequence on the physical prototype
Step 1
Device has been provisioned and activated
Create the device in the technical console. It starts PENDING. Device API access requires lifecycle ACTIVE and an active patient assignment.
Step 2
Authenticate
Send X-Device-Id and Authorization: Bearer <device-secret> on every /v1/device request.
Open notesStep 3
Send heartbeat
POST /v1/device/heartbeat with reportedStatus. Use schedule.updateAvailable to see if a newer version exists.
Open notesStep 4
Fetch current schedule
GET /v1/device/schedule. The server resolves the patient from the active assignment.
Open notesStep 5
Validate/store schedule locally
Persist schedule.id, version and items on the device before presenting medication.
Step 6
Acknowledge schedule/version
POST /v1/device/schedule/ack with the stored scheduleId and integer version.
Open notesStep 7
Simulate a medication moment
Execute the local item at plannedAt. Do not ask the platform for a patient id.
Step 8
Send the resulting event
POST /v1/device/events with a unique eventId, eventType, occurredAt and optional scheduleItemId.
Open notesStep 9
Simulate temporary offline state
Keep using the acknowledged local schedule. Buffer any new events. There is no offline API.
Open notesStep 10
Reconnect and synchronize buffered events
Send heartbeat again, then POST the buffered events. Duplicate eventId values are accepted as duplicates.
Open notes