Start an associate's shift
POST/associates/:id/shift-starts
Creates a new AssociateShift roster entry for this shift, with an initial set of certifications, raising AssociateShiftStarted. The associate id is client-supplied and this endpoint is naturally idempotent by that id: calling it twice for the same associate upserts the roster entry rather than erroring (each call still re-raises AssociateShiftStarted and returns 201). The optional siteCode records the canonical site the associate works at (ADR 0034) so the staffing gap can be scoped to a site.
Request
Responses
- 201
- 400
- 409
- 500
Shift started. Location points at the associate resource (this service has no GET route for an individual associate yet; the URI identifies the resource per RFC 7231 §7.1.2 regardless).
Response Headers
"true" when this answer is the stored replay of an earlier request with the same Idempotency-Key and fingerprint; absent on the first execution.
URI of the started associate's shift resource.
Malformed JSON body, or a required field was missing/empty (empty-associate-id, empty-path-id, empty-certification, missing-building-id -- neither siteCode nor its deprecated alias buildingId was sent --, missing-shift-id, missing-charge, unknown-path-id -- a pathId the process-path catalogue does not declare --, or malformed-request-body). The two staffing-gap list routes also answer 400 for a bad paging query: invalid-limit (not an integer 1-500, empty or repeated), invalid-cursor (undecodable or repeated) and unknown-query-parameter (any query parameter other than limit, cursor and, on the deprecated route, siteCode). On every POST a missing Idempotency-Key header is also a 400 (idempotency-key-required) and a malformed one (not 1-128 printable ASCII starting and ending with a visible character) a 400 (idempotency-key-invalid).
Conflict — this associate's roster entry was concurrently modified by another request between when it was read and when this write was attempted (concurrent-modification, ADR 0021). Only possible on a restart (the associate already has a roster entry) racing another concurrent write for the same associate; reload and retry. Also returned (idempotency-key-reused) when the Idempotency-Key was already used with a different request (method, path or body).
Unclassified failure (e.g. a persistence or event-publish error) — internal-error.