Associates
The AssociateShift aggregate: starting/ending a roster entry for a shift, certifications, and break state.
Start an associate's shift
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.
Add a certification to an associate
Adds a named qualification (e.g. 'pack', 'hazmat', 'pick') to an already-started AssociateShift, raising AssociateCertified. An associate untrained on a path cannot be assigned to it (see POST /associates/{id}/assignments). Adding a certification the associate already holds is a no-op on state (set semantics) but still re-raises the event and returns 204 — certifications are not independently addressable sub-resources, so this returns 204 rather than 201.
Start a logged break for an associate
Begins a logged break for the associate, raising AssociateBreakStarted. While on break, the associate cannot receive a new labor assignment (see POST /associates/{id}/assignments). Not idempotent: calling this while already on break is rejected as a conflict rather than treated as a no-op, since it represents a discrete state transition, not an upsert.
End a logged break for an associate
Ends the associate's current logged break, raising AssociateBreakEnded. Not idempotent: calling this while not on break is rejected as a conflict rather than treated as a no-op.
End an associate's shift
Closes the associate's shift, raising AssociateShiftEnded. Any currently active LaborAssignment is closed first (its hours logged against the shift). Idempotent: ending an already-ended shift is a no-op — no error, no event, still 204.