import { fromWiaasAddress } from "./AddressHelper";

export const fromWiaasProfileInfo = (profileInfo) => {
    return {
        id: profileInfo.id,
        idCompany: profileInfo.company_id,
        companyName: profileInfo.company_name,
        vatCode: profileInfo.vat_code,
        isCompanyAdmin: profileInfo.is_company_admin,
        mail: profileInfo.mail,
        name: profileInfo.name,
        phone: profileInfo.phone,
        billingAddresses: profileInfo.billing_addresses.map(address => fromWiaasAddress(address)),
        profileAddresses: profileInfo.profile_addresses.map(address => fromWiaasAddress(address)),
        userType: profileInfo.user_type,
    }
};