import { CustomerDTO } from '@swagger/crm';
import { CustomerBaseData } from '../defs';

export function customerDtoToCustomerBaseData(customerDto: CustomerDTO): CustomerBaseData {
  const {
    gender,
    title,
    firstName,
    lastName,
    dateOfBirth,
    customerGroup,
    createdInBranch,
    customerNumber,
    customerType,
    customerStatus,
    isGuestAccount,
    notificationChannels,
    hasOnlineAccount,
    communicationDetails,
  } = customerDto;
  return {
    gender,
    title,
    firstName,
    lastName,
    dateOfBirth,
    customerGroup,
    createdInBranch,
    customerNumber,
    customerType,
    customerStatus,
    isGuestAccount,
    notificationChannels,
    hasOnlineAccount,
    communicationDetails,
  };
}
