CASH-417 use the isBigTruck property returned from the service instead of computing it based on subType and special class
This commit is contained in:
CarlNation 2025-04-03 10:57:06 -04:00
parent 809c96e654
commit 76b26e2991
6 changed files with 42 additions and 26 deletions

View file

@ -10,6 +10,8 @@ const storeMutations = {
UPDATE_MODEL: "updateModel", UPDATE_MODEL: "updateModel",
UPDATE_STYLE: "updateStyle", UPDATE_STYLE: "updateStyle",
UPDATE_VEHICLE_SUBTYPE: "updateVehicleSubType", UPDATE_VEHICLE_SUBTYPE: "updateVehicleSubType",
UPDATE_VEHICLE_SPECIAL_CLASS: "updateVehicleSpecialClass",
UPDATE_IS_BIGTRUCK: "updateIsBigTruck",
UPDATE_CAR_ID: "updateCarId", UPDATE_CAR_ID: "updateCarId",
UPDATE_VEHICLE_CATEGORY: "updateVehicleCategory", UPDATE_VEHICLE_CATEGORY: "updateVehicleCategory",
UPDATE_VEHICLE_IMAGE_URL: "updateVehicleImageUrl", UPDATE_VEHICLE_IMAGE_URL: "updateVehicleImageUrl",

View file

@ -8,10 +8,4 @@ const vehicleCategories = {
SEMI: "SEMI", SEMI: "SEMI",
}; };
export { vehicleCategories }; export { vehicleCategories };
const vehicleSubTypes = {
HEAVY_TRUCK: "HEAVY TRUCK",
};
export { vehicleSubTypes };

View file

@ -537,7 +537,7 @@ export default {
return store.getters.order.serviceLocation.zipCode; return store.getters.order.serviceLocation.zipCode;
}, },
getIsVehicleHeavyTruckFromStore() { getIsVehicleHeavyTruckFromStore() {
return store.getters.isHeavyTruckVehicle; return store.getters.order.vehicle.isBigTruck;
}, },
getIsVehicleProtectedFromStore() { getIsVehicleProtectedFromStore() {
return store.getters.order.serviceLocation.isVehicleProtected; return store.getters.order.serviceLocation.isVehicleProtected;

View file

@ -179,10 +179,15 @@ export default {
} }
}); });
var joinedShops = shops.join(",");
if (!joinedShops) {
joinedShops = "no-shops";
}
this.pushEventToGA( this.pushEventToGA(
this.GaCategories.SERVICE_LOCATION, this.GaCategories.SERVICE_LOCATION,
gaAction, gaAction,
shops.join(","), joinedShops,
true true
); );
} }

View file

@ -49,7 +49,7 @@
placeHolderText="Select style" placeHolderText="Select style"
customDropdownId="styleQuestionField" /> customDropdownId="styleQuestionField" />
<div v-if="isHeavyTruck"> <div v-if="isBigTruckAndCanService">
<div class="separator-line"></div> <div class="separator-line"></div>
<textboxQuestion <textboxQuestion
class="mb-4" class="mb-4"
@ -110,7 +110,6 @@ import { getFunnelCookie } from "@/helpers/heritage-integration/cookie-helper";
import { applicationConfig } from "../../constants/application-config"; import { applicationConfig } from "../../constants/application-config";
import { queryStrings } from "@/constants/query-strings"; import { queryStrings } from "@/constants/query-strings";
import { getQuerystringParameter } from "@/helpers/querystring-helper"; import { getQuerystringParameter } from "@/helpers/querystring-helper";
import { vehicleSubTypes } from "@/constants/vehicle-categories.js";
//define validation rules //define validation rules
defineRule("year-required", required(errorMessages.YEAR_REQUIRED)); defineRule("year-required", required(errorMessages.YEAR_REQUIRED));
@ -130,11 +129,11 @@ export default {
selectedStyle: this.selectedStylefromStore(), selectedStyle: this.selectedStylefromStore(),
carId: this.getCarIdfromStore(), carId: this.getCarIdfromStore(),
category: this.getCategoryfromStore(), category: this.getCategoryfromStore(),
isBigTruck: this.getIsBigTruckfromStore(),
imageUrl: this.getImagefromStore(), imageUrl: this.getImagefromStore(),
imageVifNumber: this.getImageVifNumberfromStore(), imageVifNumber: this.getImageVifNumberfromStore(),
imageVifColor: this.getImageVifColorfromStore(), imageVifColor: this.getImageVifColorfromStore(),
serviceZipCode: this.getZipFromStore() ?? this.$route.query.zipcode, serviceZipCode: this.getZipFromStore() ?? this.$route.query.zipcode,
vehicleSubType: this.getVehicleSubTypefromStore(),
yearOptions: [], yearOptions: [],
makeOptions: [], makeOptions: [],
modelOptions: [], modelOptions: [],
@ -325,7 +324,7 @@ export default {
this.selectedMake = null; this.selectedMake = null;
this.selectedModel = null; this.selectedModel = null;
this.selectedStyle = null; this.selectedStyle = null;
this.vehicleSubType = null; this.isBigTruck = false;
this.canSafeliteService = false; this.canSafeliteService = false;
this.carId = null; this.carId = null;
if (year) { if (year) {
@ -346,7 +345,7 @@ export default {
this.modelOptions = []; this.modelOptions = [];
this.selectedModel = null; this.selectedModel = null;
this.selectedStyle = null; this.selectedStyle = null;
this.vehicleSubType = null; this.isBigTruck = null;
this.carId = null; this.carId = null;
if (make) { if (make) {
const result = await this.getModelOptions(this.selectedYear, make); const result = await this.getModelOptions(this.selectedYear, make);
@ -365,7 +364,7 @@ export default {
this.resetAlert(); this.resetAlert();
this.styleOptions = []; this.styleOptions = [];
this.selectedStyle = null; this.selectedStyle = null;
this.vehicleSubType = null; this.isBigTruck = false;
this.carId = null; this.carId = null;
if (model) { if (model) {
const result = await this.getStyleOptions( const result = await this.getStyleOptions(
@ -430,8 +429,8 @@ export default {
!!this.carId !!this.carId
); );
}, },
isHeavyTruck() { isBigTruckAndCanService() {
return this.vehicleSubType === vehicleSubTypes.HEAVY_TRUCK && this.canSafeliteService; return this.isBigTruck && this.canSafeliteService;
}, },
}, },
methods: { methods: {
@ -484,6 +483,8 @@ export default {
this.displayNoServiceAlert = !result?.data.canSafeliteService; this.displayNoServiceAlert = !result?.data.canSafeliteService;
this.canSafeliteService = result?.data.canSafeliteService; this.canSafeliteService = result?.data.canSafeliteService;
this.vehicleSubType = result?.data.vehicleSubType; this.vehicleSubType = result?.data.vehicleSubType;
this.vehicleSpecialClass = result?.data.vehicleSpecialClass;
this.isBigTruck = result?.data.isBigTruck;
}, },
resetAlert() { resetAlert() {
this.displayNoServiceAlert = false; this.displayNoServiceAlert = false;
@ -498,6 +499,8 @@ export default {
model: this.selectedModel, model: this.selectedModel,
style: this.selectedStyle, style: this.selectedStyle,
vehicleSubType: this.vehicleSubType, vehicleSubType: this.vehicleSubType,
vehicleSpecialClass: this.vehicleSpecialClass,
isBigTruck: this.isBigTruck,
carId: this.carId, carId: this.carId,
category: this.category, category: this.category,
canSafeliteService: this.canSafeliteService, canSafeliteService: this.canSafeliteService,
@ -508,7 +511,7 @@ export default {
false false
); );
if (this.isHeavyTruck) { if (this.isBigTruck) {
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,
@ -608,8 +611,8 @@ export default {
getImageVifColorfromStore() { getImageVifColorfromStore() {
return store.getters.vehicle.imageVifColor; return store.getters.vehicle.imageVifColor;
}, },
getVehicleSubTypefromStore() { getIsBigTruckfromStore() {
return store.getters.vehicle.vehicleSubType; return store.getters.vehicle.isBigTruck;
}, },
}, },

View file

@ -51,7 +51,6 @@ 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 = () => {
@ -63,6 +62,8 @@ const getDefaultState = () => {
model: null, model: null,
style: null, style: null,
vehicleSubType: null, vehicleSubType: null,
vehicleSpecialClass: null,
isBigTruck: false,
carId: null, carId: null,
category: null, category: null,
vin: null, vin: null,
@ -217,6 +218,12 @@ export const mutations = {
updateVehicleSubType(state, vehicleSubType) { updateVehicleSubType(state, vehicleSubType) {
state.order.vehicle.vehicleSubType = vehicleSubType; state.order.vehicle.vehicleSubType = vehicleSubType;
}, },
updateVehicleSpecialClass(state, vehicleSpecialClass) {
state.order.vehicle.vehicleSpecialClass = vehicleSpecialClass;
},
updateIsBigTruck(state, isBigTruck) {
state.order.vehicle.isBigTruck = isBigTruck;
},
updateCarId(state, carId) { updateCarId(state, carId) {
state.order.vehicle.carId = carId; state.order.vehicle.carId = carId;
}, },
@ -847,9 +854,6 @@ 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;
}, },
@ -1849,7 +1853,7 @@ export const actions = {
endPoint += `&${glassPieces}`; endPoint += `&${glassPieces}`;
} }
endPoint += `&isHeavyTruckVehicle=${context.getters.isHeavyTruckVehicle}`; endPoint += `&isHeavyTruckVehicle=${context.getters.order.vehicle.isBigTruck}`;
return globalMethods.callHttpClient({ return globalMethods.callHttpClient({
method: endpoints.GetServiceabilityDetails.method, method: endpoints.GetServiceabilityDetails.method,
@ -1878,7 +1882,7 @@ export const actions = {
url += `/${windshieldPartWithRecal.partNumber}`; url += `/${windshieldPartWithRecal.partNumber}`;
} }
//heavy truck vehicle //heavy truck vehicle
url += `/${context.getters.isHeavyTruckVehicle}`; url += `/${context.getters.order.vehicle.isBigTruck}`;
return globalMethods.callHttpClient({ return globalMethods.callHttpClient({
method: endpoints.GetProviders.method, method: endpoints.GetProviders.method,
@ -2111,6 +2115,8 @@ export const actions = {
make: vehicle.make, make: vehicle.make,
model: vehicle.model, model: vehicle.model,
subType: vehicle.vehicleSubType, subType: vehicle.vehicleSubType,
specialClass: vehicle.vehicleSpecialClass,
isBigTruck: vehicle.isBigTruck,
isInsurance: order.payment.isInsurance ?? false, isInsurance: order.payment.isInsurance ?? false,
isVerified: order.payment.insuranceCoverage.isVerified ?? false, isVerified: order.payment.insuranceCoverage.isVerified ?? false,
lineItems: { lineItems: {
@ -2165,6 +2171,8 @@ export const actions = {
style: vehicle.style, style: vehicle.style,
vin: vehicle.vin, vin: vehicle.vin,
vehicleSubType: vehicle.vehicleSubType, vehicleSubType: vehicle.vehicleSubType,
vehicleSpecialClass: vehicle.vehicleSpecialClass,
isBigTruck: vehicle.isBigTruck,
registration: { registration: {
firstName: vehicle.registration.firstName, firstName: vehicle.registration.firstName,
lastName: vehicle.registration.lastName, lastName: vehicle.registration.lastName,
@ -2381,6 +2389,8 @@ export const actions = {
model, model,
style, style,
vehicleSubType, vehicleSubType,
vehicleSpecialClass,
isBigTruck,
carId, carId,
category, category,
canSafeliteService, canSafeliteService,
@ -2404,6 +2414,8 @@ export const actions = {
context.commit(storeMutations.UPDATE_MODEL, model); context.commit(storeMutations.UPDATE_MODEL, model);
context.commit(storeMutations.UPDATE_STYLE, style); context.commit(storeMutations.UPDATE_STYLE, style);
context.commit(storeMutations.UPDATE_VEHICLE_SUBTYPE, vehicleSubType); context.commit(storeMutations.UPDATE_VEHICLE_SUBTYPE, vehicleSubType);
context.commit(storeMutations.UPDATE_VEHICLE_SPECIAL_CLASS, vehicleSpecialClass);
context.commit(storeMutations.UPDATE_IS_BIGTRUCK, isBigTruck);
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_CAN_SAFELITE_SERVICE, canSafeliteService);