E135: Update work order item
PATCH /api/work-order-items/:id
Updates an output line's quantity and/or conversion cost. A quantity change re-scales the line's BOM-input snapshot (snapshot qty × new/old — the creation-time recipe is preserved, not re-read) and rewrites the line's projected ledger events at the new quantity (reverse + re-project). The SKU itself is fixed once added — swap = remove + add.
Authentication
Standard tenant route. Requires Authorization: Bearer <firebase-id-token> and X-Org-Id: <org-id>. Access: Member.
Request
{ "quantity": 8, "conversionCost": 2.00 }
Both fields optional; a cost-only patch touches neither inputs nor ledger.
Response — 200 OK
{ "item": WorkOrderItem, "inputs": [ WorkOrderInput ] }
Errors
| HTTP | code | Condition |
|---|---|---|
| 404 | not_found | No such WO item. |
| 409 | conflict | A receipt exists against the WO — items are locked. |
| 422 | validation_failed | Shape invalid. |
Workflow
Calls W135 Update work order item.