From 07bc9d2e7d252ba1838de9c2be2e5825b20ad1d6 Mon Sep 17 00:00:00 2001 From: credelinghuys Date: Wed, 3 Jun 2026 09:00:36 -0400 Subject: [PATCH] CASH-2541: Require VIN lookup if applicable --- src/constants/store-mutations.js | 1 + src/layouts/estimate/estimate.vue | 15 ++++++++++++++- src/layouts/vehicle/vehicle.vue | 6 ++++++ src/store/index.js | 8 ++++++++ 4 files changed, 29 insertions(+), 1 deletion(-) diff --git a/src/constants/store-mutations.js b/src/constants/store-mutations.js index a06a37bb0..f95a397a0 100644 --- a/src/constants/store-mutations.js +++ b/src/constants/store-mutations.js @@ -22,6 +22,7 @@ const storeMutations = { UPDATE_VEHICLE_CAN_SAFELITE_SERVICE: "updateVehicleCanSafeliteService", UPDATE_SKIP_VIN_LOOKUP: "updateSkipVINLookup", UPDATE_SKIP_PART_QUESTIONS: "updateSkipPartQuestions", + UPDATE_VIN_REQUIRED: "updateVinRequired", UPDATE_IS_REPAIR: "updateIsRepair", UPDATE_NUMBER_OF_CHIPS: "updateNumberOfChips", diff --git a/src/layouts/estimate/estimate.vue b/src/layouts/estimate/estimate.vue index 36e27127a..49ea778a9 100644 --- a/src/layouts/estimate/estimate.vue +++ b/src/layouts/estimate/estimate.vue @@ -100,6 +100,7 @@ export default { } const zip = store.getters.order.serviceLocation.zipCode; + const isVinLookupRequired = store.getters.vehicle.vinRequired; var vinByAddressPromise; if (zip) { @@ -133,8 +134,9 @@ export default { resultMap.cmsContent.FunnelFooterWidget.ForwardButtonText = forwardTextOption[0]; } + var indexToRemove; if (!zip || resultMap.vinByAddress === false) { - var indexToRemove = resultMap.cmsContent.VinLookupMethod.Answers.findIndex( + indexToRemove = resultMap.cmsContent.VinLookupMethod.Answers.findIndex( (answer) => answer.Name === "HomeAddress" ); if (indexToRemove) { @@ -142,6 +144,17 @@ export default { } } + if (isVinLookupRequired) { + resultMap.cmsContent.FunnelSubHeaderWidget = + resultMap.cmsContent.FunnelSubHeaderWidget_VinLookupRequired; + indexToRemove = resultMap.cmsContent.VinLookupMethod.Answers.findIndex( + (answer) => answer.Name === "Decline" + ); + if (indexToRemove) { + resultMap.cmsContent.VinLookupMethod.Answers.splice(indexToRemove, 1); + } + } + vm.setCmsContent(resultMap.cmsContent); if (store.getters.externalParameterState?.isExternalParameter) { if (store.getters.externalParameterCustomer?.phoneNumber) { diff --git a/src/layouts/vehicle/vehicle.vue b/src/layouts/vehicle/vehicle.vue index 5c80694bf..dc2e758a1 100644 --- a/src/layouts/vehicle/vehicle.vue +++ b/src/layouts/vehicle/vehicle.vue @@ -143,6 +143,7 @@ export default { canSafeliteService: this.canSafeliteServiceFromStore(), skipVINLookup: this.getSkipVINLookupfromStore(), skipPartQuestions: this.getSkipPartQuestionsfromStore(), + vinRequired: this.getVinRequiredFromStore(), }; }, @@ -490,6 +491,7 @@ export default { this.isBigTruck = result?.data.isBigTruck; this.skipVINLookup = result?.data.skipVINLookup; this.skipPartQuestions = result?.data.skipPartQuestions; + this.vinRequired = result?.data.vinRequired; }, resetAlert() { this.displayNoServiceAlert = false; @@ -548,6 +550,7 @@ export default { imageVifColor: this.imageVifColor, skipVINLookup: this.skipVINLookup, skipPartQuestions: this.skipPartQuestions, + vinRequired: this.vinRequired, }, false ); @@ -639,6 +642,9 @@ export default { getSkipPartQuestionsfromStore() { return store.getters.vehicle.skipPartQuestions; }, + getVinRequiredFromStore() { + return store.getters.vehicle.vinRequired; + }, }, components: { diff --git a/src/store/index.js b/src/store/index.js index fc786d3b9..3f2cf5e0d 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -84,6 +84,7 @@ const getDefaultState = () => { }, skipVINLookup: false, skipPartQuestions: false, + vinRequired: false, }, serviceLocation: { address: null, @@ -274,6 +275,9 @@ export const mutations = { updateSkipVINLookup(state, skipVINLookup) { state.order.vehicle.skipVINLookup = skipVINLookup; }, + updateVinRequired(state, vinRequired) { + state.order.vehicle.vinRequired = vinRequired; + }, updateSkipPartQuestions(state, skipPartQuestions) { state.order.vehicle.skipPartQuestions = skipPartQuestions; }, @@ -843,6 +847,7 @@ export const mutations = { vehicleSpecialClass: sessionInformation.order.vehicle?.vehicleSpecialClass, isBigTruck: sessionInformation.order.vehicle?.isBigTruck, canSafeliteService: sessionInformation.order.vehicle?.canSafeliteService, + vinRequired: sessionInformation.order.vehicle?.vinRequired, }); state.order.damage.glassToReplace = sessionInformation.order.damage.glassToReplace; @@ -2617,6 +2622,7 @@ export const actions = { vehicleSpecialClass: vehicle.vehicleSpecialClass, isBigTruck: vehicle.isBigTruck, canSafeliteService: vehicle.canSafeliteService, + vinRequired: vehicle.vinRequired, registration: { firstName: vehicle.registration.firstName, lastName: vehicle.registration.lastName, @@ -2848,6 +2854,7 @@ export const actions = { imageVifColor, skipVINLookup, skipPartQuestions, + vinRequired, } ) { if ( @@ -2875,6 +2882,7 @@ export const actions = { context.commit(storeMutations.UPDATE_VEHICLE_IMAGE_COLOR, imageVifColor); context.commit(storeMutations.UPDATE_SKIP_VIN_LOOKUP, skipVINLookup); context.commit(storeMutations.UPDATE_SKIP_PART_QUESTIONS, skipPartQuestions); + context.commit(storeMutations.UPDATE_VIN_REQUIRED, vinRequired); } },