StrawHat.Map v0.3.1 StrawHat.Map.Country View Source
Defines functionality for countries management.
Link to this section Summary
Functions
Create a country
Destroy a country
Get a country by id
Get the list of countries
Get list of countries
Get a country by id
Get list of states
Update a country
Link to this section Functions
Link to this function
create_country(country_attrs)
View Source
create_country(StrawHat.Map.Schema.Country.country_attrs()) :: {:ok, StrawHat.Map.Schema.Country.t()} | {:error, Ecto.Changeset.t()}
Create a country.
Link to this function
destroy_country(country)
View Source
destroy_country(StrawHat.Map.Schema.Country.t()) :: {:ok, StrawHat.Map.Schema.Country.t()} | {:error, Ecto.Changeset.t()}
Destroy a country.
Link to this function
find_country(country_id)
View Source
find_country(String.t()) :: {:ok, StrawHat.Map.Schema.Country.t()} | {:error, StrawHat.Error.t()}
Get a country by id
.
Link to this function
get_countries(pagination \\ [])
View Source
get_countries(Scrivener.Config.t()) :: Scrivener.Page.t()
Get the list of countries.
Link to this function
get_countries_by_ids(country_ids)
View Source
get_countries_by_ids([integer()]) :: [StrawHat.Map.Schema.Country.t()] | no_return()
Get list of countries.
Link to this function
get_country(country_id)
View Source
get_country(String.t()) :: StrawHat.Map.Schema.Country.t() | nil | no_return()
Get a country by id
.
Link to this function
get_states(country_ids)
View Source
get_states([integer()]) :: [StrawHat.Map.Schema.State.t()] | no_return()
Get list of states.
Link to this function
update_country(country, country_attrs)
View Source
update_country( StrawHat.Map.Schema.Country.t(), StrawHat.Map.Schema.Country.country_attrs() ) :: {:ok, StrawHat.Map.Schema.Country.t()} | {:error, Ecto.Changeset.t()}
Update a country.