W100: Dispose inventory
Records the permanent removal of materials (write-off, damage, scrap, miscount-down). Triggered from the Materials Inventory page, "Dispose". Distinct from Adjust (W099) so reporting can separate loss from positive corrections.
Steps
-
Validate the material and location. Confirm both exist.
-
Write the DISPOSE ledger entry. Call
MaterialsInventory.recordDisposal({ materialId, locationId, quantity, eventDate, notes }).quantityis positive (per the L1quantity > 0invariant); the DISPOSE event type encodes "outflow", so the summary query subtracts it from on-hand.refis null.
Returns
The ledger entry.
Business rules
- Disposal is distinct from adjustment. Same effect on on-hand, but the DISPOSE event type lets reporting separate scrap and loss from positive corrections.
- No stock guard. The workflow does not block disposals that would take on-hand below zero; the notes field is the audit trail.
Errors
NotFoundError. The material or location was not found.