Algostream_order_management.Order_stateExplicit state-machine helpers on top of Algostream_domain_orders.Order.order_status.
The Domain.Order module already has a 7-state status enum (Pending / Open / Partially_filled / Filled / Cancelled / Rejected / Expired) but no explicit transition table or terminal-state predicates. This module fills that gap as pure functions — transition returns the new status for the caller to apply via Order.update_status, so we do not inject a wall-clock read into our event-time-deterministic layers.
module Order = Algostream_domain_orders.Ordertype status = Order.order_statusval is_terminal : status -> boolval is_active : status -> boolval status_name : status -> stringLegal transitions only.
val transition :
Order.order ->
to_:status ->
(status, transition_error) Stdlib.resultReturns Ok new_status if the transition is valid; the caller applies it via Order.update_status. Returns Error without mutating.