import { getPhoneNumberType, PhoneNumberType } from '@msfa-enums/phonenumber-type.enum';
import { PhoneNumberResponse } from './api/phonenumber.response.model';

export interface PhoneNumber {
  type: PhoneNumberType;
  number: string;
}

export function mapResponseToPhoneNumber(data: PhoneNumberResponse): PhoneNumber {
  return {
    type: getPhoneNumberType(data.telekomtyp),
    number: `+${data.landskod}${data.nummer_utan_inledande_nolla}`,
  };
}
