DigitalConsumer.ISS/src/constants/endpoints.js
Michaela Brydon 0db6eb1090 Tidying
2024-03-08 11:56:04 -05:00

209 lines
5.9 KiB
JavaScript

const CONTENT_BASE_URL = '/content/api/v1/content';
const LOCATION_BASE_URL = '/location/api/v1/location';
const SCHEDULE_BASE_URL = '/schedule/api/v1/schedule';
const PARTS_BASE_URL = '/parts/api/v1/parts';
const VEHICLE_BASE_URL = '/vehicle/api/v1/vehicle';
const PRICE_BASE_URL = '/price/api/v1/price';
const ACCOUNT_BASE_URL = '/account/api/v1/account';
const EXPERIMENTS_BASE_URL = '/experiments/api/v1/experiments';
const ANALYTICS_BASE_URL = '/analytics/api/v1/analytics';
const CLIENT_AUTH_BASE_URL = '/clientauth/api/v1/clientauth';
const COVERAGE_BASE_URL = '/coverage/api/v1/coverage';
const ORDER_BASE_URL = '/order/api/v1/order';
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'
},
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'
},
GetInsurancePriceOrderItems: {
url: `${PRICE_BASE_URL}/order-items-with-insurance-pricing`,
method: 'GET'
},
GetPriceOrderItems: {
url: `${PRICE_BASE_URL}/order-items`,
method: 'GET'
},
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-defense`,
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}/`,
method: 'GET'
},
TaxOrderItems: {
url: `${PRICE_BASE_URL}/taxed-order-items`,
method: 'GET'
},
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: `${LOCATION_BASE_URL}/zip`,
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: {
// eslint-disable-next-line max-len
url: (accountNumber, policyNumber, dateOfLoss) => `${ORDER_BASE_URL}/duplicate-check/${accountNumber}/${policyNumber}/${dateOfLoss}`,
method: 'GET'
},
FinalDeductible: {
url: `${COVERAGE_BASE_URL}/final-deductible`,
method: 'POST'
},
GetPaymentSignature: {
url: `${ORDER_BASE_URL}/sign`,
method: 'POST'
}
});
export { endpoints };