import { CustomerDTO } from '@swagger/crm';
import { Customer } from '../defs';
import { customerDtoToCustomerBaseData } from './customer-dto-to-customer-base-data.mapper';
import { customerDtoToCustomerAddresses } from './customer-dto-to-customer-addresses.mapper';

export function customerDtoToCustomer(customerDto: CustomerDTO): Customer {
  return {
    id: customerDto.id,
    baseData: customerDtoToCustomerBaseData(customerDto),
    addresses: customerDtoToCustomerAddresses(customerDto),
  };
}
