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.

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

Link to this function

change_event(event, attrs \\ %{})

Returns an %Ecto.Changeset{} for tracking event changes.

examples

Examples

iex> change_event(event)
%Ecto.Changeset{source: %Event{}}
Link to this function

change_item(item, attrs \\ %{})

Returns an %Ecto.Changeset{} for tracking item changes.

examples

Examples

iex> change_item(item)
%Ecto.Changeset{source: %Item{}}
Link to this function

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{}}
Link to this function

change_location(location, attrs \\ %{})

Returns an %Ecto.Changeset{} for tracking location changes.

examples

Examples

iex> change_location(location)
%Ecto.Changeset{source: %Location{}}
Link to this function

change_movement(movement, attrs \\ %{})

Returns an %Ecto.Changeset{} for tracking movement changes.

examples

Examples

iex> change_movement(movement)
%Ecto.Changeset{source: %Movement{}}
Link to this function

create_event(attrs \\ %{})

Creates a event.

examples

Examples

iex> create_event(%{field: value})
{:ok, %Event{}}

iex> create_event(%{field: bad_value})
{:error, %Ecto.Changeset{}}
Link to this function

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{}}
Link to this function

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{}}
Link to this function

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{}}
Link to this function

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{}}
Link to this function

create_movement_directly(attrs \\ %{})

Link to this function

delete_event(event)

Deletes a event.

examples

Examples

iex> delete_event(event)
{:ok, %Event{}}

iex> delete_event(event)
{:error, %Ecto.Changeset{}}
Link to this function

delete_item(item)

Deletes a item.

examples

Examples

iex> delete_item(item)
{:ok, %Item{}}

iex> delete_item(item)
{:error, %Ecto.Changeset{}}
Link to this function

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{}}
Link to this function

delete_location(location)

Deletes a location.

examples

Examples

iex> delete_location(location)
{:ok, %Location{}}

iex> delete_location(location)
{:error, %Ecto.Changeset{}}
Link to this function

delete_movement(movement)

Deletes a movement.

examples

Examples

iex> delete_movement(movement)
{:ok, %Movement{}}

iex> delete_movement(movement)
{:error, %Ecto.Changeset{}}
Link to this function

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()
Link to this function

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()

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)

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)
Link to this function

get_item_consumption(item)

Link to this function

get_item_consumption(item, location)

Link to this function

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)
Link to this function

get_item_relocations(item)

Link to this function

get_item_relocations_in(item, location)

Link to this function

get_item_relocations_out(item, location)

Link to this function

get_item_stock(item)

Link to this function

get_item_stock(item, location)

Link to this function

get_item_supply(item)

Link to this function

get_item_supply(item, location)

Link to this function

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)
Link to this function

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)

Returns the list of events.

examples

Examples

iex> list_events()
[%Event{}, ...]
Link to this function

list_item_groups(event)

Returns the list of item_groups.

examples

Examples

iex> list_item_groups()
[%ItemGroup{}, ...]
Link to this function

list_items(item_group)

Returns the list of items.

examples

Examples

iex> list_items()
[%Item{}, ...]
Link to this function

list_locations(event)

Returns the list of locations.

examples

Examples

iex> list_locations()
[%Location{}, ...]
Link to this function

list_movements(item)

Returns the list of movements.

examples

Examples

iex> list_movements()
[%Movement{}, ...]
Link to this function

list_relevant_item_groups(location)

Link to this function

list_relevant_item_groups_query(location)

Link to this function

list_relevant_items(location, item_group)

Link to this function

list_relevant_items_query(location)

Link to this function

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()
Link to this function

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()
Link to this function

logistics_table_query(event)

@spec logistics_table_query(event :: Athena.Inventory.Event.t()) :: Ecto.Queryable.t()
@spec stock_query() :: Ecto.Queryable.t()
Link to this function

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{}}
Link to this function

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{}}
Link to this function

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{}}
Link to this function

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{}}
Link to this function

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{}}