const ACCOUNT_BASE_URL = '/account/api/v1/account';
const ANALYTICS_BASE_URL = '/analytics/api/v1/analytics';
const CLIENT_AUTH_BASE_URL = '/clientauth/api/v1/clientauth';
const CONTENT_BASE_URL = '/content/api/v1/content';
const COVERAGE_BASE_URL = '/coverage/api/v1/coverage';
const EXPERIMENTS_BASE_URL = '/experiments/api/v1/experiments';
const LOCATION_BASE_URL = '/location/api/v1/location';
const ORDER_BASE_URL = '/order/api/v1/order';
const PARTS_BASE_URL = '/parts/api/v1/parts';
const PRICE_BASE_URL = '/price/api/v1/price';
const SCHEDULE_BASE_URL = '/schedule/api/v1/schedule';
const VEHICLE_BASE_URL = '/vehicle/api/v1/vehicle';

const endpoints = Object.freeze({
    GetRouteInfo: {
        url: (applicationAbbreviation) => `${CONTENT_BASE_URL}/${applicationAbbreviation}/RouteInfo`,
        method: 'POST'
    },
    GetHomepageInfo: {
        url: (applicationAbbreviation) => `${CONTENT_BASE_URL}/${applicationAbbreviation}/HomepageInfo`,
        method: 'GET'
    },
    GetPageData: {
        url: (applicationAbbreviation, pageName) => `${CONTENT_BASE_URL}/${applicationAbbreviation}/${pageName}`,
        method: 'GET'
    },
    GetBillToInfo: {
        url: `${ACCOUNT_BASE_URL}/bill-to-account-number`,
        method: 'GET'
    },
    GetAlertReasons: {
        url: `${LOCATION_BASE_URL}/alert-reasons`,
        method: 'GET'
    },
    GetShopTimeSlots: {
        url: `${SCHEDULE_BASE_URL}/shop-time-slots`,
        method: 'POST'
    },
    GetMobileTimeSlots: {
        url: `${SCHEDULE_BASE_URL}/mobile-time-slots`,
        method: 'POST'
    },
    GetMobilePremiumFee: {
        url: `${PARTS_BASE_URL}/mobile-premium-fee`,
        method: 'GET'
    },
    GetVehicleYears: {
        url: `${VEHICLE_BASE_URL}/years`,
        method: 'GET'
    },
    GetVehicleMakes: {
        url: `${VEHICLE_BASE_URL}/makes/`,
        method: 'GET'
    },
    GetVehicleModels: {
        url: `${VEHICLE_BASE_URL}/models`,
        method: 'GET'
    },
    GetVehicleStyles: {
        url: `${VEHICLE_BASE_URL}/styles`,
        method: 'GET'
    },
    GetDamageOptions: {
        url: `${PARTS_BASE_URL}/damage-options`,
        method: 'GET'
    },
    GetPartsOrQuestions: {
        url: `${PARTS_BASE_URL}/parts-or-questions`,
        method: 'POST'
    },
    GetParts: {
        url: `${PARTS_BASE_URL}/parts`,
        method: 'POST'
    },
    GetITACPriceOrderItems: {
        url: `${PRICE_BASE_URL}/order-items-with-itac-pricing`,
        method: 'POST'
    },
    GetCombinedQuote: {
        url: `${PRICE_BASE_URL}/combined-quote`,
        method: 'POST'
    },
    GetProviders: {
        url: `${LOCATION_BASE_URL}/providers`,
        method: 'GET'
    },
    GetCapabilityQuestions: {
        url: `${PARTS_BASE_URL}/capability-questions`,
        method: 'GET'
    },
    GetPartFromCapabilityAnswer: {
        url: `${PARTS_BASE_URL}/part-from-capability-answer`,
        method: 'POST'
    },
    GetWipers: {
        url: `${PARTS_BASE_URL}/wipers`,
        method: 'GET'
    },
    GetRainDefense: {
        url: `${PARTS_BASE_URL}/rain-repel`,
        method: 'GET'
    },
    GetRecalParts: {
        url: (
            carId,
            partNumber,
            recalibrationType,
            parentAccountNumber,
            zipCode,
            applicationName,
            referralSequenceNumber
        // eslint-disable-next-line max-len
        ) => `${PARTS_BASE_URL}/recal-parts/${carId}/${partNumber}/${recalibrationType}/${parentAccountNumber}/${zipCode}/${applicationName}/${referralSequenceNumber}`,
        method: 'GET'
    },
    GetGlassFees: {
        url: `${PARTS_BASE_URL}/glass-fees`,
        method: 'GET'
    },
    GetSupportingItems: {
        url: `${PARTS_BASE_URL}/supporting-items`,
        method: 'POST'
    },
    GetMobileFeePart: {
        url: `${PARTS_BASE_URL}/mobile-fee`,
        method: 'GET'
    },
    GetServiceabilityDetails: {
        url: `${LOCATION_BASE_URL}/serviceability-details`,
        method: 'GET'
    },
    GetVehicle: {
        url: `${VEHICLE_BASE_URL}/lookup`,
        method: 'GET'
    },
    GetAccountInfo: {
        url: `${ACCOUNT_BASE_URL}/account-details/`,
        method: 'GET'
    },
    TaxOrderItems: {
        url: `${PRICE_BASE_URL}/taxed-order-items`,
        method: 'POST'
    },
    LogExperimentExposureIfAssigned: {
        url: `${EXPERIMENTS_BASE_URL}/log-exposure`,
        method: 'POST'
    },
    LogPageView: {
        url: `${ANALYTICS_BASE_URL}/log-page-view`,
        method: 'POST'
    },
    LogCustomEvent: {
        url: `${ANALYTICS_BASE_URL}/log-custom-event`,
        method: 'POST'
    },
    LookupVehicleByVin: {
        url: `${VEHICLE_BASE_URL}/lookup`,
        method: 'POST'
    },
    LookupVinByAddress: {
        url: `${VEHICLE_BASE_URL}/lookup-vin-by-address`,
        method: 'POST'
    },
    LookupVinByPlate: {
        url: `${VEHICLE_BASE_URL}/lookup-vin-by-plate`,
        method: 'POST'
    },
    InitializeSession: {
        url: `${ANALYTICS_BASE_URL}/initialize`,
        method: 'POST'
    },
    GetExperimentsByUser: {
        url: `${ANALYTICS_BASE_URL}/get-experiments`,
        method: 'GET'
    },
    RunExperimentsForTrigger: {
        url: `${EXPERIMENTS_BASE_URL}/run`,
        method: 'POST'
    },
    ValidateZip: {
        url: (zip) => `${LOCATION_BASE_URL}/zip/${zip}`,
        method: 'GET'
    },
    ValidateMobileZip: {
        url: (zip, damage) => `${LOCATION_BASE_URL}/zip/${zip}/${damage}`,
        method: 'GET'
    },
    GooglePlaces: {
        url: (apiKey) => `https://maps.googleapis.com/maps/api/js?key=${apiKey}&libraries=places`
    },
    ValidateClientTag: {
        url: `${CLIENT_AUTH_BASE_URL}/validate-client-tag`,
        method: 'GET'
    },
    ValidateClientSignature: {
        url: `${CLIENT_AUTH_BASE_URL}/validate-client-signature`,
        method: 'POST'
    },
    IsVinbyAddressPermissible: {
        url: `${VEHICLE_BASE_URL}/is-vin-by-address-permissible`,
        method: 'Get'
    },
    CoveragePolicyInfo: {
        url: `${COVERAGE_BASE_URL}/policy-information`,
        method: 'POST'
    },
    RegisterClaim: {
        url: `${COVERAGE_BASE_URL}/register-claim`,
        method: 'POST'
    },
    SaveSession: {
        url: `${ORDER_BASE_URL}/save-session/iss`,
        method: 'POST'
    },
    LoadSession: {
        url: `${ORDER_BASE_URL}/load-session/iss`,
        method: 'POST'
    },
    DuplicateSearch: {
        url: `${ORDER_BASE_URL}/duplicate-check`,
        method: 'GET'
    },
    FinalDeductible: {
        url: `${COVERAGE_BASE_URL}/final-deductible`,
        method: 'POST'
    },
    GetPaymentSignature: {
        url: `${ORDER_BASE_URL}/sign`,
        method: 'POST'
    }
});

export default endpoints;
