Outsourced Production
Outsource MO
Switches an existing draft or confirmed Manufacturing Order to outsourced production. Persists `production_method=outsourced`, the contractor supplier, scheduling dates, and notes on the MO row. Writes a `production_method_changed` event with the full payload (including contractor warehouse and service fee). **Request body fields:** - `contractor_supplier_id` (int, required) — Supplier id with `is_manufacturing_contractor=true`. Must exist in `suppliers`. - `contractor_warehouse_id` (int, nullable) — Warehouse the contractor will receive components into. Must exist in `warehouses`. - `outsourced_purchase_order_id` (int, nullable) — Optional existing PO to link. Must exist in `purchase_orders`. If omitted, an Open outsourced PO is auto-created against the contractor and linked. - `scheduled_start` (datetime, nullable) — `Y-m-d H:i:s`. Persisted to `manufacturing_orders.scheduled_start`. - `scheduled_end` (datetime, nullable, must be >= scheduled_start) — Persisted to `manufacturing_orders.scheduled_end`. - `service_fee_amount` (decimal, nullable, min:0) — Recorded as a cost FinancialLine on the backing PO; flows into the MO cost_breakdown.service_fee when production is received. - `notes` (string, nullable, max:5000) — Persisted to `manufacturing_orders.notes`. **Rejected (500)** if the MO status is not `draft` or `confirmed`. **Rejected (422)** if `contractor_supplier_id` is missing or any FK does not exist.
Record Outsourced Receipt
Record receipt of finished goods from a contractor for an outsourced MO. Runs the production-costing flow: consumes the reserved components from FIFO, produces the output inventory, and costs it as materials + the PO's service fee. The MO must be Started (in_progress / partially_completed).