Planned versus observed throughput of a capacity plan (advisory)
GET/capacity-plans/:id/variance
Compares the stored plan with the TASKS fulfillment-execution reports completed (TaskCompleted, minute resolution) for the plan's bottleneck step at its location over its window, from the LOCAL observed_capacity read model (docs/adr/0017). ADVISORY: it never changes the planned capacity or the plan, and nothing is republished. Tasks are not orders, so the comparison needs tasks_per_order; without it comparison.comparable is false with the reason. observed.has_data false means nothing was observed, not zero throughput.
Request
Responses
- 200
- 400
- 404
- 422
- 500
The variance.
tasks_per_order is not a number.
No CapacityPlan exists under id.
tasks_per_order is not positive.
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.