CSR-2177 we need to allow navigation forward on a policy vehicle change so that we call parts again for the new vehicle.  Having the jump back to heritage on service-zip prevents parts from being called again so we end up in heritage with no items on the order.  Nav to heritage will still happen in the vehicle-questions-mixin logic or the quote beforerouteenter logic.
This commit is contained in:
CarlNation 2024-08-26 15:13:30 -04:00
parent 8262294b74
commit b6df3ac8d2
5 changed files with 22 additions and 22 deletions

View file

@ -33,7 +33,7 @@ export async function getDirectNavigation(toRoute) {
// vehicle -> vehicle-damage // vehicle -> vehicle-damage
// quote -> vin-lookup/estimate // quote -> vin-lookup/estimate
// insurance-company -> vin-lookup/estimate // insurance-company -> vin-lookup/estimate
if (store.getters.requiresVerifiedRedirecting) { if (store.getters.payment?.insuranceCoverage?.isVerified) {
if (fmgPageValue === fmgPageValues.VEHICLE) { if (fmgPageValue === fmgPageValues.VEHICLE) {
return fmgPageValues.VEHICLE_DAMAGE; return fmgPageValues.VEHICLE_DAMAGE;
} }
@ -132,7 +132,7 @@ export async function navigateToHeritageFunnel({ shouldSaveSession, pageNameToLo
) { ) {
heritageParms["forceEndToEndInsurance"] = true; heritageParms["forceEndToEndInsurance"] = true;
} }
router.navigateToExternalUrl(externalUrls.HERITAGE_FUNNEL, heritageParms); router.navigateToExternalUrl(externalUrls.HERITAGE_FUNNEL, heritageParms);
} }

View file

@ -125,6 +125,7 @@ import { partTypeStrings } from "@/constants/part-type-strings";
import { containsLineItemWithPartType } from "@/helpers/service-package-helper"; import { containsLineItemWithPartType } from "@/helpers/service-package-helper";
import { nextTick } from "vue"; import { nextTick } from "vue";
import { packageNames } from "@/constants/package-names"; import { packageNames } from "@/constants/package-names";
import { navigateToHeritageFunnel } from "@/helpers/heritage-integration/navigation-helper";
defineRule("option-required", required(errorMessages.OPTION_REQUIRED)); defineRule("option-required", required(errorMessages.OPTION_REQUIRED));
export default { export default {
@ -271,6 +272,20 @@ export default {
validateAlerts[0].shouldAutoFade validateAlerts[0].shouldAutoFade
); );
} }
const payment = store.getters.payment;
const policy = store.getters.policy;
const vehicleChangedDuringPolicyLookupInHeritage =
payment.isInsurance &&
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" });
}
if (store.getters.isExternalParameter) { if (store.getters.isExternalParameter) {
if (store.getters.externalParameterQuote.isInsurance == true) { if (store.getters.externalParameterQuote.isInsurance == true) {
vm.isInsuranceSelected = true; vm.isInsuranceSelected = true;

View file

@ -87,7 +87,6 @@ import {
skipVinLookupNotRepair, skipVinLookupNotRepair,
} from "@/helpers/heritage-integration/navigation-helper"; } from "@/helpers/heritage-integration/navigation-helper";
import vinPagesMixin from "@/mixins/vin-pages-mixin"; import vinPagesMixin from "@/mixins/vin-pages-mixin";
import { navigateToHeritageFunnel } from "@/helpers/heritage-integration/navigation-helper";
import { saveSession } from "@/helpers/heritage-integration/order-helper.js"; import { saveSession } from "@/helpers/heritage-integration/order-helper.js";
import baseMixin from "@/mixins/base-mixin.js"; import baseMixin from "@/mixins/base-mixin.js";
import { queryStrings } from "@/constants/query-strings"; import { queryStrings } from "@/constants/query-strings";
@ -208,17 +207,7 @@ export default {
const payment = this.$store.getters.payment; const payment = this.$store.getters.payment;
const policy = this.$store.getters.policy; const policy = this.$store.getters.policy;
const vehicleChangedDuringPolicyLookupInHeritage = if (this.$store.getters.order.referralNumber?.length === 6) {
payment.isInsurance &&
payment.insuranceCoverage.coverageStatus &&
policy.policyNumber !== "";
if (vehicleChangedDuringPolicyLookupInHeritage) {
navigateToHeritageFunnel({
shouldSaveSession: true,
pageNameToLog: "estimate",
});
} else if (this.$store.getters.order.referralNumber?.length === 6) {
await this.navigateForwardWithSingleCarMatch(); await this.navigateForwardWithSingleCarMatch();
} else if (this.isRepair) { } else if (this.isRepair) {
const supportingItemsPromise = await this.dispatchStoreActionWithLogging( const supportingItemsPromise = await this.dispatchStoreActionWithLogging(

View file

@ -398,11 +398,7 @@ export default {
}, },
methods: { methods: {
isDisabled(options) { isDisabled(options) {
if ( if (!options.length || store.getters.payment.insuranceCoverage.isVerified) {
!options.length ||
store.getters.requiresVerifiedRedirecting ||
getFunnelCookie()?.HasDelayedClaimRegistration
) {
return true; return true;
} else { } else {
return false; return false;

View file

@ -129,7 +129,7 @@ const routes = [
// Reroute around pages that should not be available. // Reroute around pages that should not be available.
// Exception 1: Integrated Users should not see vehicle or quote pages. // Exception 1: Integrated Users should not see vehicle or quote pages.
if (store.getters.requiresVerifiedRedirecting) { if (store.getters.payment?.insuranceCoverage?.isVerified) {
if (to.query.fmgPage === fmgPageValues.VEHICLE) { if (to.query.fmgPage === fmgPageValues.VEHICLE) {
to.query.fmgPage = fmgPageValues.VEHICLE_DAMAGE; to.query.fmgPage = fmgPageValues.VEHICLE_DAMAGE;
} else if ( } else if (
@ -521,7 +521,7 @@ async function DisplayPageError() {
// we use the pageError querystring as a counter to how many times a user has experienced an error and been routed here. // we use the pageError querystring as a counter to how many times a user has experienced an error and been routed here.
// once they receive more than 1 pageerrors, we'll reset their state to hopefully correct any issues they may be having. // once they receive more than 1 pageerrors, we'll reset their state to hopefully correct any issues they may be having.
var navPage = fmgPageValues.VEHICLE; var navPage = fmgPageValues.VEHICLE;
if (store.getters.requiresVerifiedRedirecting) { if (store.getters.payment?.insuranceCoverage?.isVerified) {
navPage = fmgPageValues.VEHICLE_DAMAGE; navPage = fmgPageValues.VEHICLE_DAMAGE;
} }
@ -587,7 +587,7 @@ async function runExperiments(nextPage) {
} }
function getRedirectedStartPage() { function getRedirectedStartPage() {
if (store.getters.requiresVerifiedRedirecting) { if (store.getters.payment?.insuranceCoverage?.isVerified) {
return fmgPageValues.VEHICLE_DAMAGE; return fmgPageValues.VEHICLE_DAMAGE;
} else { } else {
return funnelStartPageName; return funnelStartPageName;