diff --git a/src/constants/endpoints.js b/src/constants/endpoints.js index 594227f7b..722b22eb6 100644 --- a/src/constants/endpoints.js +++ b/src/constants/endpoints.js @@ -192,6 +192,10 @@ const endpoints = { url: "/account/api/v1/account/bill-to-account-number", method: "GET", }, + ClosestApplicableShops: { + url: "/location/api/v1/location/closest-applicable-shops", + method: "GET", + }, }; export { endpoints }; diff --git a/src/constants/store-actions.js b/src/constants/store-actions.js index baa219aa1..0a6dedd2d 100644 --- a/src/constants/store-actions.js +++ b/src/constants/store-actions.js @@ -54,6 +54,7 @@ const storeActions = { GET_INSURANCE_COMPANY_LIST: "getInsuranceCompanyList", GET_BILL_TO_ACCOUNT_NUMBER: "getBillToAccountNumber", GET_RECAL_PARTS_AND_SAVE_TO_LINE_ITEMS: "getRecalPartsAndSaveToLineItems", + GET_CLOSEST_APPLICABLE_SHOPS: "getClosestApplicableShops", // Analytics LOG_EXPERIMENT_EXPOSURE_AND_UPDATE_STORE: "logExperimentExposureAndUpdateStore", diff --git a/src/constants/store-mutations.js b/src/constants/store-mutations.js index 6a5873e83..509988c6e 100644 --- a/src/constants/store-mutations.js +++ b/src/constants/store-mutations.js @@ -17,6 +17,7 @@ const storeMutations = { UPDATE_VEHICLE_IMAGE_COLOR: "updateVehicleImageColor", UPDATE_VEHICLE_VIN: "updateVehicleVin", UPDATE_VEHICLE: "updateVehicle", + UPDATE_VEHICLE_CAN_SAFELITE_SERVICE: "updateVehicleCanSafeliteService", UPDATE_IS_REPAIR: "updateIsRepair", UPDATE_NUMBER_OF_CHIPS: "updateNumberOfChips", diff --git a/src/layouts/vehicle/vehicle.vue b/src/layouts/vehicle/vehicle.vue index fafa4c079..da4ee6689 100644 --- a/src/layouts/vehicle/vehicle.vue +++ b/src/layouts/vehicle/vehicle.vue @@ -49,7 +49,7 @@ placeHolderText="Select style" customDropdownId="styleQuestionField" /> -
+
{ @@ -65,6 +66,7 @@ const getDefaultState = () => { carId: null, category: null, vin: null, + canSafeliteService: null, imageUrl: null, imageVifNumber: null, imageColor: null, @@ -221,6 +223,9 @@ export const mutations = { updateVehicleCategory(state, category) { state.order.vehicle.category = category; }, + updateVehicleCanSafeliteService(state, canSafeliteService) { + state.order.vehicle.canSafeliteService = canSafeliteService; + }, updateVehicleImageUrl(state, imageUrl) { state.order.vehicle.imageUrl = imageUrl; }, @@ -841,6 +846,9 @@ export const getters = { return false; }, + isHeavyTruckVehicle: (state) => { + return state.order.vehicle.vehicleSubType === vehicleSubTypes.HEAVY_TRUCK; + }, isMobileAppointment: (state) => { return state.order.serviceLocation.appointmentType === AppointmentTypeStrings.MOBILE; }, @@ -1244,6 +1252,15 @@ export const actions = { }); }, + getClosestApplicableShops(context, { payload: { zip, carId }, pageNameToLog }) { + return globalMethods.callHttpClient({ + methods: endpoints.ClosestApplicableShops.method, + endpoint: `${endpoints.ClosestApplicableShops.url}/${zip}/${carId}`, + logApiCall: true, + pageNameToLog: pageNameToLog, + }); + }, + // Dependency Actions resetVehicleStateAndDependencies(context) { context.commit(storeMutations.RESET_VEHICLE_STATE); @@ -1831,6 +1848,8 @@ export const actions = { endPoint += `&${glassPieces}`; } + endPoint += `&isHeavyTruckVehicle=${context.getters.isHeavyTruckVehicle}`; + return globalMethods.callHttpClient({ method: endpoints.GetServiceabilityDetails.method, endpoint: endPoint, @@ -1857,6 +1876,8 @@ export const actions = { if (windshieldPartWithRecal) { url += `/${windshieldPartWithRecal.partNumber}`; } + //heavy truck vehicle + url += `/${context.getters.isHeavyTruckVehicle}`; return globalMethods.callHttpClient({ method: endpoints.GetProviders.method, @@ -2360,6 +2381,7 @@ export const actions = { vehicleSubType, carId, category, + canSafeliteService, imageUrl, imageVifNumber, imageVifColor, @@ -2382,6 +2404,7 @@ export const actions = { context.commit(storeMutations.UPDATE_VEHICLE_SUBTYPE, vehicleSubType); context.commit(storeMutations.UPDATE_CAR_ID, carId); context.commit(storeMutations.UPDATE_VEHICLE_CATEGORY, category); + context.commit(storeMutations.UPDATE_VEHICLE_CAN_SAFELITE_SERVICE, canSafeliteService); context.commit(storeMutations.UPDATE_VEHICLE_IMAGE_URL, imageUrl); context.commit(storeMutations.UPDATE_VEHICLE_IMAGE_VIF_NUMBER, imageVifNumber); context.commit(storeMutations.UPDATE_VEHICLE_IMAGE_COLOR, imageVifColor);