1.5 KiB
Packaging execution (Phase 2K)
After a production batch is completed, record the packaging and label materials used for its good output. One immutable record is allowed per batch. The selected packaging BOM must be active for the batch's variant when recorded; its revision and line identities remain attached afterward.
| Method | Path | Permission |
|---|---|---|
| GET | /api/v1/production-batches/:batchId/packaging |
packaging.read |
| POST | /api/v1/production-batches/:batchId/packaging |
packaging.record |
Example POST:
{
"bomId": "<active packaging BOM uuid>",
"idempotencyKey": "<uuid>",
"lines": [
{
"bomLineId": "<packaging BOM line uuid>",
"usedQuantity": "19.000",
"wastedQuantity": "1.000",
"wasteReason": "Torn box"
}
]
}
Submit every BOM line exactly once. Quantities are nonnegative, use exactly three decimal places, and use the line's material unit. Waste needs a reason. Good output must be a positive multiple of the packaging BOM output quantity. The response provides planned, used, wasted, and variance quantities for each line. An exact idempotent retry returns the existing record; a changed request with the same key returns PACKAGING_REPLAY_CONFLICT.
Packaging records are operational observations. They do not deduct physical stock or calculate costs. Those remain separate milestones pending a stock-location and costing policy.