DEPRECATED -- use GET /sites/{siteCode}/shifts/{shiftId}/staffing-gap. List the staffing gap for every path planned within one committed shift plan (fleet-wide, all-paths view)
GET/buildings/:buildingId/shifts/:shiftId/staffing-gap
This endpoint has been deprecated and may be replaced or removed in future versions of the API.
DEPRECATED alias of GET /sites/{siteCode}/shifts/{shiftId}/staffing-gap (ADR 0035): buildingId is the legacy name of the plan key. Every response carries the header Deprecation: true. It keeps working, unchanged, until a later breaking ADR removes it; a call that gives only the buildingId path segment is NOT scoped by site.
ADR-0011's deferred fast-follow: a fleet-wide "all paths, one building/shift" list endpoint, for contexts that need every path's staffing gap for a building+shift in one call rather than one request per path. Reuses the exact same per-path computation as GET /paths/{pathId}/staffing-gap — the two can never disagree for a given path — 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. The optional siteCode query parameter scopes every path's activeHeads to one canonical site (ADR 0034); without it the list is fleet-wide, as before.
Request
Responses
- 200
- 400
- 404
- 500
Staffing gap for every path planned in this building's committed shift, one entry per path.
Response Headers
true -- this route is deprecated in favour of /sites/{siteCode}/shifts/{shiftId}/staffing-gap (ADR 0035). Present on every response of this route, errors included.
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 buildingId+shiftId (resource-not-found). Also carries Deprecation: true.
Response Headers
true -- this route is deprecated (ADR 0035).
Unclassified failure (e.g. a persistence or event-publish error) — internal-error.