1
0
Fork 0
mirror of https://framagit.org/framasoft/mobilizon.git synced 2024-12-26 09:49:12 +00:00
mobilizon/lib/mobilizon_web/schema/address.ex
Thomas Citharel 289ba03960
Remove address_type and rename phone to phone_address
An event can indeed have several address types

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2019-01-14 17:48:08 +01:00

39 lines
1.1 KiB
Elixir

defmodule MobilizonWeb.Schema.AddressType do
@moduledoc """
Schema representation for Address
"""
use Absinthe.Schema.Notation
object :physical_address do
field(:type, :address_type)
field(:geom, :point)
field(:floor, :string)
field(:streetAddress, :string)
field(:addressLocality, :string)
field(:postalCode, :string)
field(:addressRegion, :string)
field(:addressCountry, :string)
field(:description, :string)
field(:name, :string)
end
object :phone_address do
field(:type, :address_type)
field(:phone, :string)
field(:info, :string)
end
object :online_address do
field(:type, :address_type)
field(:url, :string)
field(:info, :string)
end
@desc "The list of types an address can be"
enum :address_type do
value(:physical, description: "The address is physical, like a postal address")
value(:url, description: "The address is on the Web, like an URL")
value(:phone, description: "The address is a phone number for a conference")
value(:other, description: "The address is something else")
end
end