Skip to main content

Publish a DRAFT CapacityPlan

POST 

/capacity-plans/:id/publications

Moves the plan DRAFT -> PUBLISHED, saves it and queues, in the same database transaction, CapacityPlanPublished plus -- only when the plan has a shortage -- CapacityShortageDetected and BottleneckDetected in the transactional outbox. A relay publishes them to Kafka as CloudEvents (see asyncapi.yaml). Publishing twice is never silent: the second call is a 409 and queues nothing. Publishing supersedes (docs/adr/0024 decision 3): when another plan of the same site_id, location, path_id and window is PUBLISHED, that older plan becomes SUPERSEDED (superseded_by: this plan) and CapacityPlanSuperseded is queued first, in the same transaction. A SUPERSEDED plan is never published again (409).

Request​

Responses​

Plan published.

Response Headers
    Idempotency-Replayed

    Present, with the value "true", only when the answer is a replay of an earlier request with the same Idempotency-Key.