/**
 * PostNL Ecommerce APIsLib
 *
 * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
 */

import { lazy, object, optional, Schema, string } from '../schema';
import { Address3, address3Schema } from './address3';

export interface Customer {
  address?: Address3;
  /** Code of delivery location at PostNL Pakketten */
  collectionLocation?: string;
  /** Name of customer contact person */
  contactPerson?: string;
  /** Customer code as known at PostNL Pakketten */
  customerCode: string;
  /** Name of customer contact person */
  customerNumber: string;
  /** E-mail address of the customer. Mandatory for Non EU destinations. */
  email?: string;
  /** Customer name */
  name?: string;
}

export const customerSchema: Schema<Customer> = object({
  address: ['Address', optional(lazy(() => address3Schema))],
  collectionLocation: ['CollectionLocation', optional(string())],
  contactPerson: ['ContactPerson', optional(string())],
  customerCode: ['CustomerCode', string()],
  customerNumber: ['CustomerNumber', string()],
  email: ['Email', optional(string())],
  name: ['Name', optional(string())],
});
