labour-plans
The heads a process path needs for one shift at a site, sent or derived from the workload forecast (ADR 0023; moved from wes-work-planning's path plan).
Commit the labour plan of a process path for a shift at a site
Stores the heads a process path needs for one shift at one site, at a planned rate for a number of hours (docs/adr/0023 decision 2; it was wes-work-planning's path plan). planned_heads must not exceed installed_stations, hours and the rate must be positive and rate x heads x hours finite. When planned_heads is omitted it is DERIVED: ceil(forecast units with a cpt in [shift_start, shift_start + hours) / (rate x hours)), which needs shift_start and a stored workload forecast for (site_id, path_id) with at least one bucket in the shift; otherwise 422 missing-planned-heads (zero buckets in the shift is no data, never zero heads). heads_source says which happened. When the facility tally knows at least one but fewer stations of the activity named like the path (the path id upper-cased) than installed_stations, the plan is still stored with the number as sent and the answer carries a warning. 201 with version 1 for a first commit; 200 with version + 1 for a revision; 200 with the stored plan and version unchanged when the plan equals the stored one (no event). A change raises LabourPlanCommitted (integration and analytics topics, asyncapi.yaml) in the same transaction. The PUT is naturally idempotent and takes no Idempotency-Key.
Read the labour plan of a process path for a shift at a site
The stored plan of (site_id, shift_id, path_id), with the station warning computed against the facility tally at read time.
List the labour plans of a shift at a site
The plans of one (site_id, shift_id), ordered by path id, one keyset page at a time (limit + cursor; follow nextCursor until it is absent). Both filters are required and are repeated on every page request.