CASH-2541: Require VIN lookup if applicable
This commit is contained in:
parent
46a3112cce
commit
07bc9d2e7d
4 changed files with 29 additions and 1 deletions
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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: {
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue