Update an order
Entry. PUT /v1/commerce/orders/:id → OrderCommandService.update.
Checked in order-command.service.ts.
What the transaction enforces
- A status change uses
isValidOrderTransitionunlessforceis set. - If the body includes
versionand it does not matchorder.version, the update fails withorder.error.concurrencyConflict. A matching version is incremented inside the transaction. A second writer that lost the race gets a conflict. - A changed shipping address is rejected while
hasActiveShipmentis true. The error text says to cancel the shipment first. - Moving
warehouseIdenqueuesorder.location.changed. See Move warehouse. - A transition into
CONFIRMEDenqueuesorder.confirmed.
Hold and cancel on the order are status values. What they do to worksheets and reservations is What an order status does to fulfillment. force on the order update skips the order map only.
Delete
DELETE /v1/commerce/orders/:id calls orderRepository.delete, which runs Prisma delete on the order id. That removes the row. It is not a deletedAt update. The command method does not enqueue an outbox event and does not release reservations. A database foreign key can still reject the delete. That constraint was not listed here.
Failure
A throw inside the update transaction rolls the order write and the outbox row back together. Downstream fulfillment still runs only after the worker dispatches order.status.changed or order.location.changed.