Source: types/order-address.js

/* * *  *  * *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  * */
/* Copyright (c) 2018 Mobify Research & Development Inc. All rights reserved. */
/* * *  *  * *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  * */

import PropTypes from 'prop-types'
import {PhoneNumber} from './phone-number'
import {PostalCode} from './postal-code'
import {CountryCode} from './country-code'

/**
 * @memberOf module:types
 * @typedef {Object} OrderAddress
 * @property {String} id The id of the order address.
 * @property {String} titleCode The title code of the customer (i.e. 'mr', 'ms').
 * @property {String} firstName The first name of the customer.
 * @property {String} lastName The last name of the customer
 * @property {module:types.PhoneNumber} phone The customer's phone number.
 * @property {String} addressLine The street name, street number, and suite/unit.
 * @property {String} addressLine The additional addressing information (i.e. company name, "Attn:").
 * @property {module:types.CountryCode} countryCode The country code.
 * @property {String} stateCode The state code.
 * @property {String} city The city name.
 * @property {module:types.PostalCode} postalCode The postal code.
 */
export const OrderAddress = {
    id: PropTypes.string,
    titleCode: PropTypes.string,
    firstName: PropTypes.string.isRequired,
    lastName: PropTypes.string.isRequired,
    phone: PhoneNumber,
    addressLine1: PropTypes.string.isRequired,
    addressLine2: PropTypes.string,
    countryCode: CountryCode.isRequired,
    stateCode: PropTypes.string.isRequired,
    city: PropTypes.string.isRequired,
    postalCode: PostalCode.isRequired,
}