Record Production
POST/api/manufacturing/manufacturing-orders/1/record-production
Record actual component consumption, output produced, and operation actuals for an in-progress MO. Posts inventory movements (consumption + receipts) and creates FIFO layers for outputs.
Lot tracking validation (B23/B24):
outputs[].batch_numberis required when the output product isis_lot_tracked = true.outputs[].expiry_dateis required when the output product haslot_tracking_method = fefo.- Validation errors are returned per-output with dot notation, e.g.
outputs.0.batch_number.
The MO Show endpoint (GET /api/manufacturing/manufacturing-orders/{id}) exposes output_lines[].product.is_lot_tracked and output_lines[].product.lot_tracking_method so clients can drive UI gating before submitting.
Over-consumption guard (BQ8): if components[].actual_consumed_quantity exceeds the quantity reserved (Allocated) for that component line at Start, the call returns 422 with code = over_consumption and an offending[] array (per-component requested_quantity vs allocated_quantity) instead of a 500. The whole call rolls back — MO status and consumption are unchanged.
Request
Responses
- 422
Unprocessable Entity