Tai.Orders.Services.ApplyOrderTransition (tai v0.0.75)

ApplyOrderTransition is responsible for the modification of an order's state and the recording of an audit history from the applied and attempted changes.

If a transition fails validation or attempts the transition on an order with an unsupported status, it will rollback any attempted changes and record an entry in the FailedOrderTransition schema.

Link to this section Summary

Link to this section Types

Specs

attrs() :: %{:__type__ => atom(), optional(atom()) => term()}

Specs

client_id() :: Tai.Orders.Order.client_id()

Specs

order() :: Tai.Orders.Order.t()

Link to this section Functions

Link to this function

call(client_id, transition_attrs)

Specs

call(client_id(), attrs()) :: {:ok, order()} | {:error, term()}