Merge branch 'release/heavy.truck' into rlsmerge/develop-to-heavy.truck

This commit is contained in:
CarlNation 2025-03-20 15:13:10 -04:00
commit 2822e6d818
5 changed files with 55 additions and 10 deletions

View file

@ -192,6 +192,10 @@ const endpoints = {
url: "/account/api/v1/account/bill-to-account-number", url: "/account/api/v1/account/bill-to-account-number",
method: "GET", method: "GET",
}, },
ClosestApplicableShops: {
url: "/location/api/v1/location/closest-applicable-shops",
method: "GET",
},
}; };
export { endpoints }; export { endpoints };

View file

@ -54,6 +54,7 @@ const storeActions = {
GET_INSURANCE_COMPANY_LIST: "getInsuranceCompanyList", GET_INSURANCE_COMPANY_LIST: "getInsuranceCompanyList",
GET_BILL_TO_ACCOUNT_NUMBER: "getBillToAccountNumber", GET_BILL_TO_ACCOUNT_NUMBER: "getBillToAccountNumber",
GET_RECAL_PARTS_AND_SAVE_TO_LINE_ITEMS: "getRecalPartsAndSaveToLineItems", GET_RECAL_PARTS_AND_SAVE_TO_LINE_ITEMS: "getRecalPartsAndSaveToLineItems",
GET_CLOSEST_APPLICABLE_SHOPS: "getClosestApplicableShops",
// Analytics // Analytics
LOG_EXPERIMENT_EXPOSURE_AND_UPDATE_STORE: "logExperimentExposureAndUpdateStore", LOG_EXPERIMENT_EXPOSURE_AND_UPDATE_STORE: "logExperimentExposureAndUpdateStore",

View file

@ -17,6 +17,7 @@ const storeMutations = {
UPDATE_VEHICLE_IMAGE_COLOR: "updateVehicleImageColor", UPDATE_VEHICLE_IMAGE_COLOR: "updateVehicleImageColor",
UPDATE_VEHICLE_VIN: "updateVehicleVin", UPDATE_VEHICLE_VIN: "updateVehicleVin",
UPDATE_VEHICLE: "updateVehicle", UPDATE_VEHICLE: "updateVehicle",
UPDATE_VEHICLE_CAN_SAFELITE_SERVICE: "updateVehicleCanSafeliteService",
UPDATE_IS_REPAIR: "updateIsRepair", UPDATE_IS_REPAIR: "updateIsRepair",
UPDATE_NUMBER_OF_CHIPS: "updateNumberOfChips", UPDATE_NUMBER_OF_CHIPS: "updateNumberOfChips",

View file

@ -49,7 +49,7 @@
placeHolderText="Select style" placeHolderText="Select style"
customDropdownId="styleQuestionField" /> customDropdownId="styleQuestionField" />
<div v-if="showHeavyTruck"> <div v-if="isHeavyTruck">
<div class="separator-line"></div> <div class="separator-line"></div>
<textboxQuestion <textboxQuestion
class="mb-4" class="mb-4"
@ -140,6 +140,7 @@ export default {
modelOptions: [], modelOptions: [],
styleOptions: [], styleOptions: [],
displayNoServiceAlert: false, displayNoServiceAlert: false,
canSafeliteService: this.canSafeliteServiceFromStore(),
}; };
}, },
@ -315,6 +316,9 @@ export default {
}, },
watch: { watch: {
serviceZipCode(newValue, oldValue) {
this.resetAlert();
},
async selectedYear(year) { async selectedYear(year) {
this.resetAlert(); this.resetAlert();
this.makeOptions = []; this.makeOptions = [];
@ -322,6 +326,7 @@ export default {
this.selectedModel = null; this.selectedModel = null;
this.selectedStyle = null; this.selectedStyle = null;
this.vehicleSubType = null; this.vehicleSubType = null;
this.canSafeliteService = false;
this.carId = null; this.carId = null;
if (year) { if (year) {
const result = await this.getMakeOptions(year); const result = await this.getMakeOptions(year);
@ -425,10 +430,8 @@ export default {
!!this.carId !!this.carId
); );
}, },
showHeavyTruck() { isHeavyTruck() {
return ( return this.vehicleSubType === vehicleSubTypes.HEAVY_TRUCK && this.canSafeliteService;
this.vehicleSubType === vehicleSubTypes.HEAVY_TRUCK && !this.displayNoServiceAlert
);
}, },
}, },
methods: { methods: {
@ -479,11 +482,8 @@ export default {
this.imageVifNumber = result?.data.imageVifNumber; this.imageVifNumber = result?.data.imageVifNumber;
this.imageVifColor = result?.data.imageVifColor; this.imageVifColor = result?.data.imageVifColor;
this.displayNoServiceAlert = !result?.data.canSafeliteService; this.displayNoServiceAlert = !result?.data.canSafeliteService;
this.canSafeliteService = result?.data.canSafeliteService;
this.vehicleSubType = result?.data.vehicleSubType; this.vehicleSubType = result?.data.vehicleSubType;
// if (this.showHeavyTruck) {
// }
}, },
resetAlert() { resetAlert() {
this.displayNoServiceAlert = false; this.displayNoServiceAlert = false;
@ -500,6 +500,7 @@ export default {
vehicleSubType: this.vehicleSubType, vehicleSubType: this.vehicleSubType,
carId: this.carId, carId: this.carId,
category: this.category, category: this.category,
canSafeliteService: this.canSafeliteService,
imageUrl: this.imageUrl, imageUrl: this.imageUrl,
imageVifNumber: this.imageVifNumber, imageVifNumber: this.imageVifNumber,
imageVifColor: this.imageVifColor, imageVifColor: this.imageVifColor,
@ -507,7 +508,7 @@ export default {
false false
); );
if (this.showHeavyTruck) { if (this.isHeavyTruck) {
const zipCodeData = await this.getZipCodeData(this.serviceZipCode); const zipCodeData = await this.getZipCodeData(this.serviceZipCode);
await this.dispatchStoreAction( await this.dispatchStoreAction(
storeActions.SAVE_SERVICE_ZIP_CODE_INFO, storeActions.SAVE_SERVICE_ZIP_CODE_INFO,
@ -518,6 +519,18 @@ export default {
}, },
false false
); );
// check the location endpoint to verify this zip can service a heavy truck
var closestShops = await this.dispatchStoreActionWithLogging(
storeActions.GET_CLOSEST_APPLICABLE_SHOPS,
{ zip: this.serviceZipCode, carId: this.carId },
"vehicle"
);
if (!closestShops || closestShops.data?.providers?.length === 0) {
this.displayNoServiceAlert = true;
return this.$refs.navbar.removeLoader();
}
} }
this.$router.navigateWithSaving(this.navigationScenarios.CLICKED_FORWARD, this.$route); this.$router.navigateWithSaving(this.navigationScenarios.CLICKED_FORWARD, this.$route);
@ -545,6 +558,9 @@ export default {
selectedStylefromStore() { selectedStylefromStore() {
return store.getters.externalParameterVehicle.style ?? store.getters.vehicle.style; return store.getters.externalParameterVehicle.style ?? store.getters.vehicle.style;
}, },
canSafeliteServiceFromStore() {
return store.getters.vehicle.canSafeliteService ?? false;
},
async getMakeOptions(year) { async getMakeOptions(year) {
return await baseMixin.methods.dispatchStoreActionWithLogging( return await baseMixin.methods.dispatchStoreActionWithLogging(
storeActions.GET_VEHICLE_MAKES, storeActions.GET_VEHICLE_MAKES,

View file

@ -51,6 +51,7 @@ import {
import { externalParameterStatus } from "@/constants/external-parameters"; import { externalParameterStatus } from "@/constants/external-parameters";
import { experimentSettings } from "@/constants/experiments"; import { experimentSettings } from "@/constants/experiments";
import experimentMixin from "@/mixins/experiment-mixin.js"; import experimentMixin from "@/mixins/experiment-mixin.js";
import { vehicleSubTypes } from "@/constants/vehicle-categories.js";
// Export State // Export State
const getDefaultState = () => { const getDefaultState = () => {
@ -65,6 +66,7 @@ const getDefaultState = () => {
carId: null, carId: null,
category: null, category: null,
vin: null, vin: null,
canSafeliteService: null,
imageUrl: null, imageUrl: null,
imageVifNumber: null, imageVifNumber: null,
imageColor: null, imageColor: null,
@ -221,6 +223,9 @@ export const mutations = {
updateVehicleCategory(state, category) { updateVehicleCategory(state, category) {
state.order.vehicle.category = category; state.order.vehicle.category = category;
}, },
updateVehicleCanSafeliteService(state, canSafeliteService) {
state.order.vehicle.canSafeliteService = canSafeliteService;
},
updateVehicleImageUrl(state, imageUrl) { updateVehicleImageUrl(state, imageUrl) {
state.order.vehicle.imageUrl = imageUrl; state.order.vehicle.imageUrl = imageUrl;
}, },
@ -841,6 +846,9 @@ export const getters = {
return false; return false;
}, },
isHeavyTruckVehicle: (state) => {
return state.order.vehicle.vehicleSubType === vehicleSubTypes.HEAVY_TRUCK;
},
isMobileAppointment: (state) => { isMobileAppointment: (state) => {
return state.order.serviceLocation.appointmentType === AppointmentTypeStrings.MOBILE; 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 // Dependency Actions
resetVehicleStateAndDependencies(context) { resetVehicleStateAndDependencies(context) {
context.commit(storeMutations.RESET_VEHICLE_STATE); context.commit(storeMutations.RESET_VEHICLE_STATE);
@ -1831,6 +1848,8 @@ export const actions = {
endPoint += `&${glassPieces}`; endPoint += `&${glassPieces}`;
} }
endPoint += `&isHeavyTruckVehicle=${context.getters.isHeavyTruckVehicle}`;
return globalMethods.callHttpClient({ return globalMethods.callHttpClient({
method: endpoints.GetServiceabilityDetails.method, method: endpoints.GetServiceabilityDetails.method,
endpoint: endPoint, endpoint: endPoint,
@ -1857,6 +1876,8 @@ export const actions = {
if (windshieldPartWithRecal) { if (windshieldPartWithRecal) {
url += `/${windshieldPartWithRecal.partNumber}`; url += `/${windshieldPartWithRecal.partNumber}`;
} }
//heavy truck vehicle
url += `/${context.getters.isHeavyTruckVehicle}`;
return globalMethods.callHttpClient({ return globalMethods.callHttpClient({
method: endpoints.GetProviders.method, method: endpoints.GetProviders.method,
@ -2360,6 +2381,7 @@ export const actions = {
vehicleSubType, vehicleSubType,
carId, carId,
category, category,
canSafeliteService,
imageUrl, imageUrl,
imageVifNumber, imageVifNumber,
imageVifColor, imageVifColor,
@ -2382,6 +2404,7 @@ export const actions = {
context.commit(storeMutations.UPDATE_VEHICLE_SUBTYPE, vehicleSubType); context.commit(storeMutations.UPDATE_VEHICLE_SUBTYPE, vehicleSubType);
context.commit(storeMutations.UPDATE_CAR_ID, carId); context.commit(storeMutations.UPDATE_CAR_ID, carId);
context.commit(storeMutations.UPDATE_VEHICLE_CATEGORY, category); 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_URL, imageUrl);
context.commit(storeMutations.UPDATE_VEHICLE_IMAGE_VIF_NUMBER, imageVifNumber); context.commit(storeMutations.UPDATE_VEHICLE_IMAGE_VIF_NUMBER, imageVifNumber);
context.commit(storeMutations.UPDATE_VEHICLE_IMAGE_COLOR, imageVifColor); context.commit(storeMutations.UPDATE_VEHICLE_IMAGE_COLOR, imageVifColor);