Merge pull request #3205 from Safelite/feature/CASH-2541
CASH-2541: Require VIN lookup if applicable
This commit is contained in:
commit
ecddf439d1
4 changed files with 29 additions and 1 deletions
|
|
@ -22,6 +22,7 @@ const storeMutations = {
|
||||||
UPDATE_VEHICLE_CAN_SAFELITE_SERVICE: "updateVehicleCanSafeliteService",
|
UPDATE_VEHICLE_CAN_SAFELITE_SERVICE: "updateVehicleCanSafeliteService",
|
||||||
UPDATE_SKIP_VIN_LOOKUP: "updateSkipVINLookup",
|
UPDATE_SKIP_VIN_LOOKUP: "updateSkipVINLookup",
|
||||||
UPDATE_SKIP_PART_QUESTIONS: "updateSkipPartQuestions",
|
UPDATE_SKIP_PART_QUESTIONS: "updateSkipPartQuestions",
|
||||||
|
UPDATE_VIN_REQUIRED: "updateVinRequired",
|
||||||
|
|
||||||
UPDATE_IS_REPAIR: "updateIsRepair",
|
UPDATE_IS_REPAIR: "updateIsRepair",
|
||||||
UPDATE_NUMBER_OF_CHIPS: "updateNumberOfChips",
|
UPDATE_NUMBER_OF_CHIPS: "updateNumberOfChips",
|
||||||
|
|
|
||||||
|
|
@ -100,6 +100,7 @@ export default {
|
||||||
}
|
}
|
||||||
|
|
||||||
const zip = store.getters.order.serviceLocation.zipCode;
|
const zip = store.getters.order.serviceLocation.zipCode;
|
||||||
|
const isVinLookupRequired = store.getters.vehicle.vinRequired;
|
||||||
|
|
||||||
var vinByAddressPromise;
|
var vinByAddressPromise;
|
||||||
if (zip) {
|
if (zip) {
|
||||||
|
|
@ -133,8 +134,9 @@ export default {
|
||||||
resultMap.cmsContent.FunnelFooterWidget.ForwardButtonText = forwardTextOption[0];
|
resultMap.cmsContent.FunnelFooterWidget.ForwardButtonText = forwardTextOption[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var indexToRemove;
|
||||||
if (!zip || resultMap.vinByAddress === false) {
|
if (!zip || resultMap.vinByAddress === false) {
|
||||||
var indexToRemove = resultMap.cmsContent.VinLookupMethod.Answers.findIndex(
|
indexToRemove = resultMap.cmsContent.VinLookupMethod.Answers.findIndex(
|
||||||
(answer) => answer.Name === "HomeAddress"
|
(answer) => answer.Name === "HomeAddress"
|
||||||
);
|
);
|
||||||
if (indexToRemove) {
|
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);
|
vm.setCmsContent(resultMap.cmsContent);
|
||||||
if (store.getters.externalParameterState?.isExternalParameter) {
|
if (store.getters.externalParameterState?.isExternalParameter) {
|
||||||
if (store.getters.externalParameterCustomer?.phoneNumber) {
|
if (store.getters.externalParameterCustomer?.phoneNumber) {
|
||||||
|
|
|
||||||
|
|
@ -143,6 +143,7 @@ export default {
|
||||||
canSafeliteService: this.canSafeliteServiceFromStore(),
|
canSafeliteService: this.canSafeliteServiceFromStore(),
|
||||||
skipVINLookup: this.getSkipVINLookupfromStore(),
|
skipVINLookup: this.getSkipVINLookupfromStore(),
|
||||||
skipPartQuestions: this.getSkipPartQuestionsfromStore(),
|
skipPartQuestions: this.getSkipPartQuestionsfromStore(),
|
||||||
|
vinRequired: this.getVinRequiredFromStore(),
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -490,6 +491,7 @@ export default {
|
||||||
this.isBigTruck = result?.data.isBigTruck;
|
this.isBigTruck = result?.data.isBigTruck;
|
||||||
this.skipVINLookup = result?.data.skipVINLookup;
|
this.skipVINLookup = result?.data.skipVINLookup;
|
||||||
this.skipPartQuestions = result?.data.skipPartQuestions;
|
this.skipPartQuestions = result?.data.skipPartQuestions;
|
||||||
|
this.vinRequired = result?.data.vinRequired;
|
||||||
},
|
},
|
||||||
resetAlert() {
|
resetAlert() {
|
||||||
this.displayNoServiceAlert = false;
|
this.displayNoServiceAlert = false;
|
||||||
|
|
@ -548,6 +550,7 @@ export default {
|
||||||
imageVifColor: this.imageVifColor,
|
imageVifColor: this.imageVifColor,
|
||||||
skipVINLookup: this.skipVINLookup,
|
skipVINLookup: this.skipVINLookup,
|
||||||
skipPartQuestions: this.skipPartQuestions,
|
skipPartQuestions: this.skipPartQuestions,
|
||||||
|
vinRequired: this.vinRequired,
|
||||||
},
|
},
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
|
|
@ -639,6 +642,9 @@ export default {
|
||||||
getSkipPartQuestionsfromStore() {
|
getSkipPartQuestionsfromStore() {
|
||||||
return store.getters.vehicle.skipPartQuestions;
|
return store.getters.vehicle.skipPartQuestions;
|
||||||
},
|
},
|
||||||
|
getVinRequiredFromStore() {
|
||||||
|
return store.getters.vehicle.vinRequired;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
components: {
|
components: {
|
||||||
|
|
|
||||||
|
|
@ -84,6 +84,7 @@ const getDefaultState = () => {
|
||||||
},
|
},
|
||||||
skipVINLookup: false,
|
skipVINLookup: false,
|
||||||
skipPartQuestions: false,
|
skipPartQuestions: false,
|
||||||
|
vinRequired: false,
|
||||||
},
|
},
|
||||||
serviceLocation: {
|
serviceLocation: {
|
||||||
address: null,
|
address: null,
|
||||||
|
|
@ -274,6 +275,9 @@ export const mutations = {
|
||||||
updateSkipVINLookup(state, skipVINLookup) {
|
updateSkipVINLookup(state, skipVINLookup) {
|
||||||
state.order.vehicle.skipVINLookup = skipVINLookup;
|
state.order.vehicle.skipVINLookup = skipVINLookup;
|
||||||
},
|
},
|
||||||
|
updateVinRequired(state, vinRequired) {
|
||||||
|
state.order.vehicle.vinRequired = vinRequired;
|
||||||
|
},
|
||||||
updateSkipPartQuestions(state, skipPartQuestions) {
|
updateSkipPartQuestions(state, skipPartQuestions) {
|
||||||
state.order.vehicle.skipPartQuestions = skipPartQuestions;
|
state.order.vehicle.skipPartQuestions = skipPartQuestions;
|
||||||
},
|
},
|
||||||
|
|
@ -843,6 +847,7 @@ export const mutations = {
|
||||||
vehicleSpecialClass: sessionInformation.order.vehicle?.vehicleSpecialClass,
|
vehicleSpecialClass: sessionInformation.order.vehicle?.vehicleSpecialClass,
|
||||||
isBigTruck: sessionInformation.order.vehicle?.isBigTruck,
|
isBigTruck: sessionInformation.order.vehicle?.isBigTruck,
|
||||||
canSafeliteService: sessionInformation.order.vehicle?.canSafeliteService,
|
canSafeliteService: sessionInformation.order.vehicle?.canSafeliteService,
|
||||||
|
vinRequired: sessionInformation.order.vehicle?.vinRequired,
|
||||||
});
|
});
|
||||||
|
|
||||||
state.order.damage.glassToReplace = sessionInformation.order.damage.glassToReplace;
|
state.order.damage.glassToReplace = sessionInformation.order.damage.glassToReplace;
|
||||||
|
|
@ -2617,6 +2622,7 @@ export const actions = {
|
||||||
vehicleSpecialClass: vehicle.vehicleSpecialClass,
|
vehicleSpecialClass: vehicle.vehicleSpecialClass,
|
||||||
isBigTruck: vehicle.isBigTruck,
|
isBigTruck: vehicle.isBigTruck,
|
||||||
canSafeliteService: vehicle.canSafeliteService,
|
canSafeliteService: vehicle.canSafeliteService,
|
||||||
|
vinRequired: vehicle.vinRequired,
|
||||||
registration: {
|
registration: {
|
||||||
firstName: vehicle.registration.firstName,
|
firstName: vehicle.registration.firstName,
|
||||||
lastName: vehicle.registration.lastName,
|
lastName: vehicle.registration.lastName,
|
||||||
|
|
@ -2848,6 +2854,7 @@ export const actions = {
|
||||||
imageVifColor,
|
imageVifColor,
|
||||||
skipVINLookup,
|
skipVINLookup,
|
||||||
skipPartQuestions,
|
skipPartQuestions,
|
||||||
|
vinRequired,
|
||||||
}
|
}
|
||||||
) {
|
) {
|
||||||
if (
|
if (
|
||||||
|
|
@ -2875,6 +2882,7 @@ export const actions = {
|
||||||
context.commit(storeMutations.UPDATE_VEHICLE_IMAGE_COLOR, imageVifColor);
|
context.commit(storeMutations.UPDATE_VEHICLE_IMAGE_COLOR, imageVifColor);
|
||||||
context.commit(storeMutations.UPDATE_SKIP_VIN_LOOKUP, skipVINLookup);
|
context.commit(storeMutations.UPDATE_SKIP_VIN_LOOKUP, skipVINLookup);
|
||||||
context.commit(storeMutations.UPDATE_SKIP_PART_QUESTIONS, skipPartQuestions);
|
context.commit(storeMutations.UPDATE_SKIP_PART_QUESTIONS, skipPartQuestions);
|
||||||
|
context.commit(storeMutations.UPDATE_VIN_REQUIRED, vinRequired);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue