Athena.Inventory (athena_logistics v1.0.0)
The Inventory context.
Link to this section Summary
Functions
Returns an %Ecto.Changeset{}
for tracking event changes.
Returns an %Ecto.Changeset{}
for tracking item changes.
Returns an %Ecto.Changeset{}
for tracking item_group changes.
Returns an %Ecto.Changeset{}
for tracking location changes.
Returns an %Ecto.Changeset{}
for tracking movement changes.
Creates a event.
Creates a item.
Creates a item_group.
Creates a location.
Creates a movement.
Deletes a event.
Deletes a item.
Deletes a item_group.
Deletes a location.
Deletes a movement.
Gets a single event.
Gets a single item.
Gets a single item_group.
Gets a single location.
Gets a single movement.
Returns the list of events.
Returns the list of item_groups.
Returns the list of items.
Returns the list of locations.
Returns the list of movements.
Updates a event.
Updates a item.
Updates a item_group.
Updates a location.
Updates a movement.
Link to this section Functions
change_event(event, attrs \\ %{})
Returns an %Ecto.Changeset{}
for tracking event changes.
examples
Examples
iex> change_event(event)
%Ecto.Changeset{source: %Event{}}
change_item(item, attrs \\ %{})
Returns an %Ecto.Changeset{}
for tracking item changes.
examples
Examples
iex> change_item(item)
%Ecto.Changeset{source: %Item{}}
change_item_group(item_group, attrs \\ %{})
Returns an %Ecto.Changeset{}
for tracking item_group changes.
examples
Examples
iex> change_item_group(item_group)
%Ecto.Changeset{source: %ItemGroup{}}
change_location(location, attrs \\ %{})
Returns an %Ecto.Changeset{}
for tracking location changes.
examples
Examples
iex> change_location(location)
%Ecto.Changeset{source: %Location{}}
change_movement(movement, attrs \\ %{})
Returns an %Ecto.Changeset{}
for tracking movement changes.
examples
Examples
iex> change_movement(movement)
%Ecto.Changeset{source: %Movement{}}
create_event(attrs \\ %{})
Creates a event.
examples
Examples
iex> create_event(%{field: value})
{:ok, %Event{}}
iex> create_event(%{field: bad_value})
{:error, %Ecto.Changeset{}}
create_item(item_group, attrs \\ %{})
Creates a item.
examples
Examples
iex> create_item(%{field: value})
{:ok, %Item{}}
iex> create_item(%{field: bad_value})
{:error, %Ecto.Changeset{}}
create_item_group(event, attrs \\ %{})
Creates a item_group.
examples
Examples
iex> create_item_group(%{field: value})
{:ok, %ItemGroup{}}
iex> create_item_group(%{field: bad_value})
{:error, %Ecto.Changeset{}}
create_location(event, attrs \\ %{})
Creates a location.
examples
Examples
iex> create_location(%{field: value})
{:ok, %Location{}}
iex> create_location(%{field: bad_value})
{:error, %Ecto.Changeset{}}
create_movement(item, attrs \\ %{})
Creates a movement.
examples
Examples
iex> create_movement(%{field: value})
{:ok, %Movement{}}
iex> create_movement(%{field: bad_value})
{:error, %Ecto.Changeset{}}
create_movement_directly(attrs \\ %{})
delete_event(event)
Deletes a event.
examples
Examples
iex> delete_event(event)
{:ok, %Event{}}
iex> delete_event(event)
{:error, %Ecto.Changeset{}}
delete_item(item)
Deletes a item.
examples
Examples
iex> delete_item(item)
{:ok, %Item{}}
iex> delete_item(item)
{:error, %Ecto.Changeset{}}
delete_item_group(item_group)
Deletes a item_group.
examples
Examples
iex> delete_item_group(item_group)
{:ok, %ItemGroup{}}
iex> delete_item_group(item_group)
{:error, %Ecto.Changeset{}}
delete_location(location)
Deletes a location.
examples
Examples
iex> delete_location(location)
{:ok, %Location{}}
iex> delete_location(location)
{:error, %Ecto.Changeset{}}
delete_movement(movement)
Deletes a movement.
examples
Examples
iex> delete_movement(movement)
{:ok, %Movement{}}
iex> delete_movement(movement)
{:error, %Ecto.Changeset{}}
event_totals_by_event_query(query \\ Event.Total, event)
@spec event_totals_by_event_query( query :: Ecto.Queryable.t(), event :: Athena.Inventory.Event.t() ) :: Ecto.Queryable.t()
event_totals_by_item_query(query \\ Event.Total, item)
@spec event_totals_by_item_query( query :: Ecto.Queryable.t(), item :: Athena.Inventory.Item.t() ) :: Ecto.Queryable.t()
get_event!(id)
Gets a single event.
Raises Ecto.NoResultsError
if the Event does not exist.
examples
Examples
iex> get_event!(123)
%Event{}
iex> get_event!(456)
** (Ecto.NoResultsError)
get_item!(id)
Gets a single item.
Raises Ecto.NoResultsError
if the Item does not exist.
examples
Examples
iex> get_item!(123)
%Item{}
iex> get_item!(456)
** (Ecto.NoResultsError)
get_item_consumption(item)
get_item_consumption(item, location)
get_item_group!(id)
Gets a single item_group.
Raises Ecto.NoResultsError
if the Item group does not exist.
examples
Examples
iex> get_item_group!(123)
%ItemGroup{}
iex> get_item_group!(456)
** (Ecto.NoResultsError)
get_item_relocations(item)
get_item_relocations_in(item, location)
get_item_relocations_out(item, location)
get_item_stock(item)
get_item_stock(item, location)
get_item_supply(item)
get_item_supply(item, location)
get_location!(id)
Gets a single location.
Raises Ecto.NoResultsError
if the Location does not exist.
examples
Examples
iex> get_location!(123)
%Location{}
iex> get_location!(456)
** (Ecto.NoResultsError)
get_movement!(id)
Gets a single movement.
Raises Ecto.NoResultsError
if the Movement does not exist.
examples
Examples
iex> get_movement!(123)
%Movement{}
iex> get_movement!(456)
** (Ecto.NoResultsError)
list_events()
Returns the list of events.
examples
Examples
iex> list_events()
[%Event{}, ...]
list_item_groups(event)
Returns the list of item_groups.
examples
Examples
iex> list_item_groups()
[%ItemGroup{}, ...]
list_items(item_group)
Returns the list of items.
examples
Examples
iex> list_items()
[%Item{}, ...]
list_locations(event)
Returns the list of locations.
examples
Examples
iex> list_locations()
[%Location{}, ...]
list_movements(item)
Returns the list of movements.
examples
Examples
iex> list_movements()
[%Movement{}, ...]
list_relevant_item_groups(location)
list_relevant_item_groups_query(location)
list_relevant_items(location, item_group)
list_relevant_items_query(location)
location_totals_by_item_query(query \\ Location.Total, item)
@spec location_totals_by_item_query( query :: Ecto.Queryable.t(), item :: Athena.Inventory.Item.t() ) :: Ecto.Queryable.t()
location_totals_by_location_query(query \\ Location.Total, location)
@spec location_totals_by_location_query( query :: Ecto.Queryable.t(), location :: Athena.Inventory.Location.t() ) :: Ecto.Queryable.t()
logistics_table_query(event)
@spec logistics_table_query(event :: Athena.Inventory.Event.t()) :: Ecto.Queryable.t()
stock_query()
@spec stock_query() :: Ecto.Queryable.t()
update_event(event, attrs)
Updates a event.
examples
Examples
iex> update_event(event, %{field: new_value})
{:ok, %Event{}}
iex> update_event(event, %{field: bad_value})
{:error, %Ecto.Changeset{}}
update_item(item, attrs)
Updates a item.
examples
Examples
iex> update_item(item, %{field: new_value})
{:ok, %Item{}}
iex> update_item(item, %{field: bad_value})
{:error, %Ecto.Changeset{}}
update_item_group(item_group, attrs)
Updates a item_group.
examples
Examples
iex> update_item_group(item_group, %{field: new_value})
{:ok, %ItemGroup{}}
iex> update_item_group(item_group, %{field: bad_value})
{:error, %Ecto.Changeset{}}
update_location(location, attrs)
Updates a location.
examples
Examples
iex> update_location(location, %{field: new_value})
{:ok, %Location{}}
iex> update_location(location, %{field: bad_value})
{:error, %Ecto.Changeset{}}
update_movement(movement, attrs)
Updates a movement.
examples
Examples
iex> update_movement(movement, %{field: new_value})
{:ok, %Movement{}}
iex> update_movement(movement, %{field: bad_value})
{:error, %Ecto.Changeset{}}