CSR-2202
CSR-2202 allow unverified insurance users to return to quote page
This commit is contained in:
parent
dfd3eb601f
commit
73553f82db
2 changed files with 56 additions and 13 deletions
|
|
@ -207,7 +207,10 @@ export default {
|
||||||
...servicePackageDiscountPart,
|
...servicePackageDiscountPart,
|
||||||
];
|
];
|
||||||
|
|
||||||
// When calling pricing from the quote page, always use the cash parent account
|
// When calling pricing from the quote page, always use the cash parent account but save the existing one in case it's unverified insurance navigating backwards
|
||||||
|
var holdParentAccountNumber = store.getters.order.payment?.parentAccountNumber;
|
||||||
|
var holdBillToAccountNumber = store.getters.order.payment?.billToAccountNumber;
|
||||||
|
|
||||||
baseMixin.methods.dispatchStoreAction(
|
baseMixin.methods.dispatchStoreAction(
|
||||||
storeActions.SAVE_PARENT_ACCOUNT_NUMBER,
|
storeActions.SAVE_PARENT_ACCOUNT_NUMBER,
|
||||||
applicationConfig.CASH_PARENT_ACCOUNT_NUMBER,
|
applicationConfig.CASH_PARENT_ACCOUNT_NUMBER,
|
||||||
|
|
@ -260,6 +263,8 @@ export default {
|
||||||
vm.lineItems = lineItems;
|
vm.lineItems = lineItems;
|
||||||
vm.availableLineItems = pricingResults;
|
vm.availableLineItems = pricingResults;
|
||||||
vm.isInsuranceSelected = vm.getDefaultIsInsuranceSelectedValue(vm.availableLineItems);
|
vm.isInsuranceSelected = vm.getDefaultIsInsuranceSelectedValue(vm.availableLineItems);
|
||||||
|
vm.holdParentAccountNumber = holdParentAccountNumber;
|
||||||
|
vm.holdBillToAccountNumber = holdBillToAccountNumber;
|
||||||
|
|
||||||
if (revalidatePromoResponse) {
|
if (revalidatePromoResponse) {
|
||||||
const revalidateAlerts = buildToastMessagesFromRevalidateOrValidatePromoResponse(
|
const revalidateAlerts = buildToastMessagesFromRevalidateOrValidatePromoResponse(
|
||||||
|
|
@ -280,18 +285,11 @@ export default {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This is a safeguard to prevent verified insurance from seeing quote page again.
|
||||||
const payment = store.getters.payment;
|
const payment = store.getters.payment;
|
||||||
const policy = store.getters.policy;
|
if (payment?.isInsurance && payment?.insuranceCoverage?.isVerified) {
|
||||||
if (payment?.isInsurance) {
|
|
||||||
const vehicleChangedDuringPolicyLookupInHeritage =
|
|
||||||
payment.insuranceCoverage?.coverageStatus && policy?.policyNumber !== "";
|
|
||||||
|
|
||||||
// This is a safeguard to prevent insurance from seeing quote page again.
|
|
||||||
// Usually this is caught in vehicle-questions-mixin with a referral length 6 check
|
|
||||||
if (vehicleChangedDuringPolicyLookupInHeritage) {
|
|
||||||
navigateToHeritageFunnel({ shouldSaveSession: true, pageNameToLog: "quote" });
|
navigateToHeritageFunnel({ shouldSaveSession: true, pageNameToLog: "quote" });
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (store.getters.externalParameterState?.isExternalParameter) {
|
if (store.getters.externalParameterState?.isExternalParameter) {
|
||||||
if (store.getters.externalParameterQuote.isInsurance == true) {
|
if (store.getters.externalParameterQuote.isInsurance == true) {
|
||||||
|
|
@ -319,6 +317,8 @@ export default {
|
||||||
lineItems: [],
|
lineItems: [],
|
||||||
addableVaps: [],
|
addableVaps: [],
|
||||||
servicePackage: null,
|
servicePackage: null,
|
||||||
|
holdParentAccountNumber: null,
|
||||||
|
holdBillToAccountNumber: null,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
|
@ -352,13 +352,44 @@ export default {
|
||||||
this.$refs[modalName].openModal();
|
this.$refs[modalName].openModal();
|
||||||
},
|
},
|
||||||
arePagePrerequisitesValid() {
|
arePagePrerequisitesValid() {
|
||||||
|
const payment = store.getters.order.payment;
|
||||||
|
const log = getQuerystringParameter(queryStrings.LOG);
|
||||||
|
if (eval(log)) {
|
||||||
|
console.log("quote.vue pagePrereqs:");
|
||||||
|
console.log(
|
||||||
|
new Date() +
|
||||||
|
" store.getters.order.serviceLocation.zipCode: " +
|
||||||
|
store.getters.order.serviceLocation?.zipCode
|
||||||
|
);
|
||||||
|
console.log(
|
||||||
|
new Date() +
|
||||||
|
" store.getters.order.serviceLocation.zipCodeCtu: " +
|
||||||
|
store.getters.order.serviceLocation?.zipCodeCtu
|
||||||
|
);
|
||||||
|
console.log(
|
||||||
|
new Date() +
|
||||||
|
" store.getters.order.damage.isRepair: " +
|
||||||
|
store.getters.order.damage?.isRepair
|
||||||
|
);
|
||||||
|
console.log(
|
||||||
|
new Date() +
|
||||||
|
" store.getters.order.lineItems?.glassParts: " +
|
||||||
|
JSON.stringify(store.getters.order.lineItems?.glassParts)
|
||||||
|
);
|
||||||
|
console.log(
|
||||||
|
new Date() +
|
||||||
|
" store.getters.order.payment.insuranceCoverage?.isVerified: " +
|
||||||
|
payment?.insuranceCoverage?.isVerified
|
||||||
|
);
|
||||||
|
}
|
||||||
return (
|
return (
|
||||||
store.getters.order.serviceLocation.zipCode &&
|
store.getters.order.serviceLocation.zipCode &&
|
||||||
store.getters.order.serviceLocation.zipCodeCtu &&
|
store.getters.order.serviceLocation.zipCodeCtu &&
|
||||||
(store.getters.order.damage.isRepair ||
|
(store.getters.order.damage.isRepair ||
|
||||||
(store.getters.order.lineItems?.glassParts != null &&
|
(store.getters.order.lineItems?.glassParts != null &&
|
||||||
store.getters.order.lineItems.glassParts.length > 0)) &&
|
store.getters.order.lineItems.glassParts.length > 0)) &&
|
||||||
store.getters.order.referralNumber?.length !== 6
|
(payment.insuranceCoverage?.isVerified == null ||
|
||||||
|
payment.insuranceCoverage?.isVerified === false)
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
getDefaultIsInsuranceSelectedValue(availableLineItems) {
|
getDefaultIsInsuranceSelectedValue(availableLineItems) {
|
||||||
|
|
@ -412,6 +443,17 @@ export default {
|
||||||
applicationConfig.CASH_DEFAULT_BILL_TO_ACCOUNT_NUMBER,
|
applicationConfig.CASH_DEFAULT_BILL_TO_ACCOUNT_NUMBER,
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
|
} else {
|
||||||
|
baseMixin.methods.dispatchStoreAction(
|
||||||
|
storeActions.SAVE_PARENT_ACCOUNT_NUMBER,
|
||||||
|
this.holdParentAccountNumber,
|
||||||
|
false
|
||||||
|
);
|
||||||
|
baseMixin.methods.dispatchStoreAction(
|
||||||
|
storeActions.SAVE_BILL_TO_ACCOUNT_NUMBER,
|
||||||
|
this.holdBillToAccountNumber,
|
||||||
|
false
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
|
|
|
||||||
|
|
@ -503,7 +503,8 @@ export default {
|
||||||
this.recalibrationInformationModal.openModal();
|
this.recalibrationInformationModal.openModal();
|
||||||
},
|
},
|
||||||
backButtonAction() {
|
backButtonAction() {
|
||||||
if (store.getters.order.payment.isInsurance) {
|
const payment = store.getters.order.payment;
|
||||||
|
if (payment?.isInsurance && payment?.insuranceCoverage?.isVerified) {
|
||||||
navigateToHeritageFunnel({ shouldSaveSession: false });
|
navigateToHeritageFunnel({ shouldSaveSession: false });
|
||||||
} else {
|
} else {
|
||||||
this.$router.navigateWithoutSaving(
|
this.$router.navigateWithoutSaving(
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue