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",
method: "GET",
},
ClosestApplicableShops: {
url: "/location/api/v1/location/closest-applicable-shops",
method: "GET",
},
};
export { endpoints };

View file

@ -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",

View file

@ -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",

View file

@ -49,7 +49,7 @@
placeHolderText="Select style"
customDropdownId="styleQuestionField" />
<div v-if="showHeavyTruck">
<div v-if="isHeavyTruck">
<div class="separator-line"></div>
<textboxQuestion
class="mb-4"
@ -140,6 +140,7 @@ export default {
modelOptions: [],
styleOptions: [],
displayNoServiceAlert: false,
canSafeliteService: this.canSafeliteServiceFromStore(),
};
},
@ -315,6 +316,9 @@ export default {
},
watch: {
serviceZipCode(newValue, oldValue) {
this.resetAlert();
},
async selectedYear(year) {
this.resetAlert();
this.makeOptions = [];
@ -322,6 +326,7 @@ export default {
this.selectedModel = null;
this.selectedStyle = null;
this.vehicleSubType = null;
this.canSafeliteService = false;
this.carId = null;
if (year) {
const result = await this.getMakeOptions(year);
@ -425,10 +430,8 @@ export default {
!!this.carId
);
},
showHeavyTruck() {
return (
this.vehicleSubType === vehicleSubTypes.HEAVY_TRUCK && !this.displayNoServiceAlert
);
isHeavyTruck() {
return this.vehicleSubType === vehicleSubTypes.HEAVY_TRUCK && this.canSafeliteService;
},
},
methods: {
@ -479,11 +482,8 @@ export default {
this.imageVifNumber = result?.data.imageVifNumber;
this.imageVifColor = result?.data.imageVifColor;
this.displayNoServiceAlert = !result?.data.canSafeliteService;
this.canSafeliteService = result?.data.canSafeliteService;
this.vehicleSubType = result?.data.vehicleSubType;
// if (this.showHeavyTruck) {
// }
},
resetAlert() {
this.displayNoServiceAlert = false;
@ -500,6 +500,7 @@ export default {
vehicleSubType: this.vehicleSubType,
carId: this.carId,
category: this.category,
canSafeliteService: this.canSafeliteService,
imageUrl: this.imageUrl,
imageVifNumber: this.imageVifNumber,
imageVifColor: this.imageVifColor,
@ -507,7 +508,7 @@ export default {
false
);
if (this.showHeavyTruck) {
if (this.isHeavyTruck) {
const zipCodeData = await this.getZipCodeData(this.serviceZipCode);
await this.dispatchStoreAction(
storeActions.SAVE_SERVICE_ZIP_CODE_INFO,
@ -518,6 +519,18 @@ export default {
},
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);
@ -545,6 +558,9 @@ export default {
selectedStylefromStore() {
return store.getters.externalParameterVehicle.style ?? store.getters.vehicle.style;
},
canSafeliteServiceFromStore() {
return store.getters.vehicle.canSafeliteService ?? false;
},
async getMakeOptions(year) {
return await baseMixin.methods.dispatchStoreActionWithLogging(
storeActions.GET_VEHICLE_MAKES,

View file

@ -51,6 +51,7 @@ import {
import { externalParameterStatus } from "@/constants/external-parameters";
import { experimentSettings } from "@/constants/experiments";
import experimentMixin from "@/mixins/experiment-mixin.js";
import { vehicleSubTypes } from "@/constants/vehicle-categories.js";
// Export State
const getDefaultState = () => {
@ -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);