EngageSoftware / elm-engage-common / Engage.Entity.Address

Entity.Address


type alias Address =
{ addressType : Maybe AddressType
, addressId : Maybe Basics.Int
, name : String
, address1 : String
, address2 : String
, country : Maybe Engage.ListItem.ListItem
, region : Maybe Engage.ListItem.ListItem
, city : String
, postalCode : String
, phone : Engage.Entity.PhoneNumber.PhoneNumber
, fax : Engage.Entity.PhoneNumber.PhoneNumber
, website : String
, relativeOrder : Basics.Int
, isPrimaryAddress : Basics.Bool
, includeInInternalDirectory : Basics.Bool
, includeInExternalDirectory : Basics.Bool 
}

The Address type


type alias AddressLike a =
{ a | address1 : String
, address2 : String
, country : Maybe Engage.ListItem.ListItem
, region : Maybe Engage.ListItem.ListItem
, city : String
, postalCode : String 
}

The AddressLike type


type alias AddressType =
{ addressTypeId : Basics.Int
, shortDescription : String
, longDescription : String 
}

The AddressType type


type alias AddressTypes =
Dict AddressTypeId AddressType

The AddressTypes type


type alias Countries =
Dict CountryId CountryData

The Countries type


type alias CountryId =
Basics.Int

The CountryId type


type alias RegionId =
Basics.Int

The RegionId type


type alias Regions =
Dict RegionId RegionData

The Regions type


type alias RegionsCountry =
Dict CountryId Regions

The RegionsCountry type

addressTypeDecoder : Json.Decode.Decoder AddressType

An AddressType decoder

addressTypesDecoder : Json.Decode.Decoder AddressTypes

An AddressTypes decoder

countriesDecoder : Json.Decode.Decoder Countries

The Countries decoder

decoder : Json.Decode.Decoder Address

The Address decoder

empty : Address

Get an empty Address

emptyAddressType : AddressType

Get an empty AddressType

emptyPrimaryAddress : Address

Get an empty primary Address

encoder : Address -> Json.Encode.Value

The Address encoder

encoderWith : List ( String, Json.Encode.Value ) -> Address -> Json.Encode.Value

The Address encoder with fields

getRegionsForCountry : CountryId -> RegionsCountry -> Regions

Get Regions for a country

regionsCountryDecoder : Json.Decode.Decoder RegionsCountry

The RegionsCountry decoder