Skip to main content

Assign an associate to a path

POST 

/associates/:id/assignments

Puts an associate on pathId for a new interval, raising LaborAssigned (first assignment) or LaborReassigned (an assignment was already active). The "exactly one ACTIVE assignment per associate" invariant is enforced by construction, not by rejecting a second call: if the associate already has an active assignment, it is closed first (its hours are logged against the associate's shift) and the new one starts — this matches how rebalancing actually happens on the floor, a supervisor moves someone without first "unassigning" them. The assignment requires the associate hold the path's required certification (by convention, the Certification with the same name as the PathId — e.g. path "pack" requires certification "pack"), and is rejected if the associate is currently on a logged break or their shift has ended. Because each call closes the prior interval and raises an event, a blind retry would double-apply it, so this route is protected by the Idempotency-Key header (ADR-0027, ADR-0044): a retried request with the same key and body replays the first response — unless the first answer was RETRYABLE (e.g. certification-required, associate-on-break, concurrent-modification), which is not stored: the key is released and the retry executes again once the state allows it.

Request​

Responses​

Associate assigned. Location points at this associate's assignment resource (at most one active assignment exists per associate, so the collection URI identifies it).

Response Headers
    Idempotency-Replayed

    "true" when this answer is the stored replay of an earlier request with the same Idempotency-Key and fingerprint; absent on the first execution.

    Location

    URI of the associate's assignment resource.