Tai.Orders.OrderStore (tai v0.0.65)

Track and manage the local state of orders with a swappable backend

Link to this section Summary

Functions

Return a list of all orders currently stored in the backend

Returns a specification to start this module under a supervisor.

Return the number of orders currently stored in the backend

Enqueue an order from the submission by adding it into the backend

Return the order from the backend that matches the given client_id

Callback implementation for GenServer.init/1.

Update the state of the order from the transitions params

Link to this section Types

Specs

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

Specs

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

Specs

status() :: Tai.Orders.Order.status()

Specs

store_id() :: atom()
Link to this type

submission()

Specs

Link to this type

transition()

Specs

transition() :: Tai.Orders.Transition.t()

Link to this section Functions

Link to this function

all(store_id \\ :default)

Return a list of all orders currently stored in the backend

Link to this function

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

Link to this function

count(store_id \\ :default)

Return the number of orders currently stored in the backend

Link to this function

enqueue(submission, store_id \\ :default)

Enqueue an order from the submission by adding it into the backend

Link to this function

find_by_client_id(client_id, store_id \\ :default)

Return the order from the backend that matches the given client_id

Link to this function

handle_continue(atom, state)

Callback implementation for GenServer.handle_continue/2.

Callback implementation for GenServer.init/1.

Link to this function

start_link(args)

Link to this function

to_name(store_id)

Specs

to_name(store_id()) :: atom()
Link to this function

update(transition, store_id \\ :default)

Update the state of the order from the transitions params