Skip to main content

Reverse Production Iteration

POST 

/api/manufacturing/manufacturing-orders/1/production-iterations/0fa1c2bb-8b1b-4c5a-9d63-1f4b5e6d7c80/reverse

Reverses a production iteration: restores input FIFO layers, deletes the output layer (if not yet drawn from), rolls back actuals on the component/output lines, decrements completed_quantity on the MO, and writes a production_reversed audit event. Refuses with 422 if already reversed, mismatched MO, or downstream-drawn.

Request body:

  • reason (string, optional, max 1000) — free-text reason for the reversal

Failure modes (422 JSON with discriminator code):

  • iteration_already_reversed
  • downstream_draw_blocks_reverse — carries details.layer_id, details.fulfilled_quantity, details.original_quantity
  • iteration_belongs_to_other_mo

Success: 200 with the refreshed ManufacturingOrderResource.

Request

Responses

OK

Response Headers
    Content-Type