Purchase order state machine
Last updated 2026-10-19
Purchase order states and events: from draft to released, with approval flow and cancellation rules.

Event table#
| Event | From | To | Trigger | Actor | Side effects |
|---|---|---|---|---|---|
| [submit] | draft | pending_approval | Submit for approval | Buyer | — |
| [approve] | pending_approval | approved | Approval granted | Approver | — |
| [reject] | pending_approval | draft | Approval rejected | Approver | Can be fixed and resubmitted |
| [release] | approved | released | Release to the supplier | Buyer | WMS inbound receipt created at the same time |
| Receiving done | released | completed | Inbound receipt fully received | System | Pending: completed may be removed (no writes in production) |
| [cancel] | draft / pending_approval / approved | cancelled | Cancel the PO | Buyer | — |
| [cancel] | released | cancelled | Cancel the PO | Buyer | Linked inbound receipt → cancelled as well |
partially_received and completed are pending removal (zero writes in production). The PO flow effectively ends at released; receiving progress lives on the WMS inbound receipt.