Receive the workload forecast of a process path at a site
PUT/workload-forecasts/:site_id/:path_id
Stores the volume a process path is expected to receive at a site, as CPT buckets (docs/adr/0023 decision 1; it was wes-work-planning's charge forecast). One forecast per (site_id, path_id); a receipt replaces the buckets as a whole. 201 with version 1 for a first receipt; 200 with version + 1 when the buckets changed; 200 with the stored forecast, its version and received_at unchanged, when the buckets equal the stored ones (same order): nothing is written and no event is raised. A receipt that changed something raises WorkloadForecastReceived (integration and analytics topics, asyncapi.yaml) in the same transaction. The PUT is naturally idempotent and takes no Idempotency-Key.
Request
Responses
- 200
- 201
- 400
- 409
- 422
- 500
The buckets replaced the stored ones (version + 1), or equal them (nothing changed).
A first receipt; the forecast is stored at version 1.
Malformed JSON (a fractional quantity included) or a cpt that is not RFC 3339 (malformed-json, malformed-cpt).
The stored version moved twice while the receipt was applied (version-conflict); retry it.
No bucket (no-forecast-buckets), a bucket without cpt (missing-cpt) or quantity (missing-bucket-quantity), or a negative quantity (negative-bucket-quantity).
An unexpected failure (a store or outbox error). Answered as problem+json (internal-error). A 5xx answer is never stored under an Idempotency-Key and rolls back the aggregate change and its outbox rows, so the retry re-executes.