List the staffing gap for every path planned within one committed shift plan of a site (canonical route)
GET/sites/:siteCode/shifts/:shiftId/staffing-gap
The canonical route of the all-paths staffing-gap list (ADR 0035; supersedes GET /buildings/{buildingId}/shifts/{shiftId}/staffing-gap, which stays as a deprecated alias). Same handler core and response shape. The path siteCode is both the plan lookup key and the associate scope: every path's activeHeads counts only associates with an active shift at that site (ADR 0034). Reuses the exact same per-path computation as GET /paths/{pathId}/staffing-gap and raises PathUnderstaffed for every understaffed path in the plan. This surfaces the gaps only — it never decides or performs a rebalance; that stays a human call recorded via POST /associates/{id}/assignments.
Request
Responses
- 200
- 400
- 404
- 500
Staffing gap for every path planned in this site's committed shift, one entry per path, scoped to the site.
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).
No committed ShiftPlan exists for siteCode+shiftId (resource-not-found).
Unclassified failure (e.g. a persistence or event-publish error) — internal-error.