Propose planned heads for a path (pure computation, not committed)
POST/paths/:pathId/plan-proposals
Two forms (ADR 0043). FROM THE LABOUR PLAN: omit charge and name shiftId (with siteCode): proposedHeads is the planned_heads warehouse-planning published for (siteCode, shiftId, pathId) in LabourPlanCommitted (this service keeps a local copy), resolvedRate its rate_units_per_hour, rateSource is labour-plan and NO idle-share trim applies; nothing published is 404 labour-plan-not-found, never zero heads. CHARGE-BASED (DEPRECATED, unchanged; removed only by a later ADR once no caller sends a charge): a request with charge, even one that also names shiftId, works as described below. Neither charge nor shiftId is 400 missing-charge. Both forms raise ShiftPlanProposed. Computes heads = ceil(charge / plannedRate) for one path and raises ShiftPlanProposed for visibility — it persists nothing and commits nothing. A human must still call POST /shift-plans to commit an actual ShiftPlan. This is why the response is 200, not 201: no resource is created. When a high observed idle share (idleness-as-staffing-signal, fed back from labor-performance via LABOR_PERFORMANCE_MODE=kafka-cache) is available for this path's task type and exceeds IDLE_SHARE_TRIM_THRESHOLD (default 0.30), the computed heads are further trimmed (floored at 1 head minimum) and trimReason explains why — fail-open: no idle-share signal available applies no trim.
Request
Responses
- 200
- 400
- 404
- 409
- 422
- 500
Proposed heads for this path, not committed.
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.
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 charge was sent and warehouse-planning has published no labour plan for (siteCode, shiftId, pathId) (labour-plan-not-found, ADR 0043). Never answered as zero heads.
The Idempotency-Key was already used with a different request (method, path or body) (idempotency-key-reused, ADR-0027). Use a new key for a genuinely different request.
The request carried both the canonical siteCode and its deprecated alias buildingId with DIFFERENT values (conflicting-site-and-building, ADR 0035). They name the same thing; send one, or send the same value in both.
Unclassified failure (e.g. a persistence or event-publish error) — internal-error.