<#Architecture class="bcard-title" lang="en" dir="ltr">
Order Management System Design: State Machines
#Architecture>
Order, payment and fulfilment as three separate state machines: enums declare the legal transitions, one service enforces them under a row lock with a full audit trail, plus split shipments and capped partial refunds - with tested code.