StrawHat.Map v1.2.1 StrawHat.Map.Cities View Source

Defines functionality for cities management.

Link to this section Summary

Functions

Creates a city

Destroys a city

Gets a city by id

Gets the list of cities

Gets list of cities

Gets a city by id

Returns the postal code rule of the associated country

Link to this section Functions

Link to this function create_city(city_attrs) View Source
create_city(StrawHat.Map.City.city_attrs()) ::
  {:ok, StrawHat.Map.City.t()} | {:error, Ecto.Changeset.t()}

Creates a city.

Link to this function destroy_city(city) View Source
destroy_city(StrawHat.Map.City.t()) ::
  {:ok, StrawHat.Map.City.t()} | {:error, Ecto.Changeset.t()}

Destroys a city.

Link to this function find_city(city_id) View Source
find_city(String.t()) ::
  {:ok, StrawHat.Map.City.t()} | {:error, StrawHat.Error.t()}

Gets a city by id.

Link to this function get_cities(pagination \\ []) View Source

Gets the list of cities.

Link to this function get_cities_by_ids(city_ids) View Source
get_cities_by_ids([integer()]) :: [StrawHat.Map.City.t()] | no_return()

Gets list of cities.

Gets a city by id.

Link to this function get_postal_code_rule(city_id) View Source
get_postal_code_rule(Integer.t()) :: Regex.t() | nil

Returns the postal code rule of the associated country.

Updates a city.