CASH-2380: Get SkipVinLookup and SkipPartQuestions from vehicle service and skip when applicable.

This commit is contained in:
credelinghuys 2026-04-03 11:06:54 -04:00
parent 80d6896908
commit 2dd528fadb
8 changed files with 54 additions and 18916 deletions

View file

@ -18,6 +18,7 @@ const GaCategories = {
INSHOP_CONFIRMATION_CLICKED: "inshop confirmation clicked",
MOBILE_CONFIRMATION_CLICKED: "mobile confirmation clicked",
RECAL_DISCLAIMER: "Recalibration disclaimer",
VIN_ELIGIBLE: "VIN eligible",
};
const GaActions = {
@ -32,6 +33,8 @@ const GaActions = {
MORE_LOCATIONS_CLICKED: "more_locations_clicked",
YES: "yes",
NO: "no",
TRUE: "true",
FALSE: "false",
ACKNOWLEDGED: "Acknowledged",
};

File diff suppressed because it is too large Load diff

View file

@ -20,6 +20,8 @@ const storeMutations = {
UPDATE_VEHICLE_VIN: "updateVehicleVin",
UPDATE_VEHICLE: "updateVehicle",
UPDATE_VEHICLE_CAN_SAFELITE_SERVICE: "updateVehicleCanSafeliteService",
UPDATE_SKIP_VIN_LOOKUP: "updateSkipVINLookup",
UPDATE_SKIP_PART_QUESTIONS: "updateSkipPartQuestions",
UPDATE_IS_REPAIR: "updateIsRepair",
UPDATE_NUMBER_OF_CHIPS: "updateNumberOfChips",

View file

@ -499,6 +499,14 @@ export default {
policy.policyNumber !== "";
const skipVin = await skipVinLookup();
this.pushEventToGA(
this.GaCategories.VIN_ELIGIBLE,
skipVin ? this.GaActions.FALSE : this.GaActions.TRUE,
this.$store.getters.vehicle.carId,
true
);
if (vehicleChangedDuringPolicyLookupInHeritage) {
if (skipVin) {
this.$router.navigateWithSaving(

View file

@ -141,6 +141,8 @@ export default {
styleOptions: [],
displayNoServiceAlert: false,
canSafeliteService: this.canSafeliteServiceFromStore(),
skipVINLookup: this.getSkipVINLookupfromStore(),
skipPartQuestions: this.getSkipPartQuestionsfromStore(),
};
},
@ -486,6 +488,8 @@ export default {
this.vehicleSubType = result?.data.vehicleSubType;
this.vehicleSpecialClass = result?.data.vehicleSpecialClass;
this.isBigTruck = result?.data.isBigTruck;
this.skipVINLookup = result?.data.skipVINLookup;
this.skipPartQuestions = result?.data.skipPartQuestions;
},
resetAlert() {
this.displayNoServiceAlert = false;
@ -542,6 +546,8 @@ export default {
imageUrl: this.imageUrl,
imageVifNumber: this.imageVifNumber,
imageVifColor: this.imageVifColor,
skipVINLookup: this.skipVINLookup,
skipPartQuestions: this.skipPartQuestions,
},
false
);
@ -627,6 +633,12 @@ export default {
getIsBigTruckfromStore() {
return store.getters.vehicle.isBigTruck;
},
getSkipVINLookupfromStore() {
return store.getters.vehicle.skipVINLookup;
},
getSkipPartQuestionsfromStore() {
return store.getters.vehicle.skipPartQuestions;
},
},
components: {

View file

@ -5,6 +5,8 @@ import { storeActions } from "@/constants/store-actions";
import { navigateToHeritageFunnel } from "@/helpers/heritage-integration/navigation-helper";
import baseMixin from "@/mixins/base-mixin.js";
import store from "@/store";
import { getIsWindshieldOnly } from "@/helpers/damage-helper";
import { partTypeStrings } from "@/constants/part-type-strings";
export default {
methods: {
@ -367,8 +369,13 @@ export default {
const hasChildPartQuestions = this.hasChildPartQuestions(partsOrQuestions);
const hasCapabilityQuestions = this.hasCapabilityQuestions(partsOrQuestions);
const isWindshieldOnly =
getIsWindshieldOnly().toUpperCase() === partTypeStrings.WINDSHIELD;
const skipPartQuestions = store.getters.vehicle?.skipPartQuestions && isWindshieldOnly;
if (
hasPartQuestions &&
!skipPartQuestions &&
this.currentPageComesBeforePage(currentPage, routeData.PART_QUESTIONS.name)
) {
self.$router.navigateWithPageData(
@ -378,6 +385,7 @@ export default {
);
} else if (
hasGlassLocationWithMultipleParts &&
!skipPartQuestions &&
this.currentPageComesBeforePage(currentPage, routeData.VEHICLE_PARTS.name)
) {
// if multiple parts on any glass
@ -389,6 +397,7 @@ export default {
);
} else if (
hasChildPartQuestions &&
!skipPartQuestions &&
this.currentPageComesBeforePage(currentPage, routeData.MOLDING_QUESTIONS.name)
) {
// if any childpart questions

View file

@ -9,7 +9,6 @@ import { storeActions } from "@/constants/store-actions";
import { applicationConfig } from "@/constants/application-config";
import { experimentTriggers } from "@/constants/experiments";
import { damageLocationsSelected } from "@/constants/damage-locations-selected";
import { singleWindshieldCarIds } from "@/constants/single-windshield-carids";
import { routeData } from "@/router/constants/routes";
import {
deleteFunnelCookie,
@ -83,6 +82,8 @@ const getDefaultState = () => {
registration: {
licensePlate: null,
},
skipVINLookup: false,
skipPartQuestions: false,
},
serviceLocation: {
address: null,
@ -252,6 +253,15 @@ export const mutations = {
updateVehicleCanSafeliteService(state, canSafeliteService) {
state.order.vehicle.canSafeliteService = canSafeliteService;
},
updateSkipVINLookup(state, skipVINLookup) {
state.order.vehicle.skipVINLookup = skipVINLookup;
},
updateSkipPartQuestions(state, skipPartQuestions) {
state.order.vehicle.skipPartQuestions = skipPartQuestions;
},
updateSkipCapabilitiesQuestions(state, skipCapabilitiesQuestions) {
state.order.vehicle.skipCapabilitiesQuestions = skipCapabilitiesQuestions;
},
updateVehicleImageUrl(state, imageUrl) {
state.order.vehicle.imageUrl = imageUrl;
},
@ -2698,6 +2708,8 @@ export const actions = {
imageUrl,
imageVifNumber,
imageVifColor,
skipVINLookup,
skipPartQuestions,
}
) {
if (
@ -2723,6 +2735,8 @@ export const actions = {
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);
context.commit(storeMutations.UPDATE_SKIP_VIN_LOOKUP, skipVINLookup);
context.commit(storeMutations.UPDATE_SKIP_PART_QUESTIONS, skipPartQuestions);
}
},
@ -3517,25 +3531,7 @@ export const actions = {
},
isVinOptionalVehicle(context) {
//Optional for carIds with only a single windshield
if (singleWindshieldCarIds.find((item) => item === context.state.order.vehicle.carId)) {
return true;
}
//Optional for specific YMMSs
switch (context.state.order.vehicle.make.toLowerCase()) {
case "porsche":
return true;
default:
}
if (
(context.state.order.vehicle.make.toLowerCase() === "bmw" &&
context.state.order.vehicle.year < 2010) ||
(context.state.order.vehicle.make.toLowerCase() === "volkswagen" &&
context.state.order.vehicle.year < 2010) ||
(context.state.order.vehicle.make.toLowerCase() === "audi" &&
context.state.order.vehicle.year < 2010)
)
return true;
if (context.state.order.vehicle.skipVINLookup) return true;
return false;
},

View file

@ -4261,6 +4261,8 @@ describe("isVinOptionalVehicle", () => {
},
};
mutations.updateSkipVINLookup(context.state, expectedVinSkip);
var vinOptionalResult = actions.isVinOptionalVehicle(context);
expect(vinOptionalResult).toEqual(expectedVinSkip);
}
@ -4291,6 +4293,8 @@ describe("isVinOptionalVehicle", () => {
},
};
mutations.updateSkipVINLookup(context.state, expectedVinSkip);
var vinOptionalResult = actions.isVinOptionalVehicle(context);
expect(vinOptionalResult).toEqual(expectedVinSkip);
}