From b2b355c5f7317eed794fd1148ed4fcd243199f75 Mon Sep 17 00:00:00 2001 From: CarlNation <32103961+CarlNation@users.noreply.github.com> Date: Mon, 15 Apr 2024 10:39:58 -0400 Subject: [PATCH] CSR-2074 CSR-2074 allow skipvin logic when returning through flow from heritage --- src/layouts/vehicle-damage/vehicle-damage.vue | 27 +++++++++++++------ 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/src/layouts/vehicle-damage/vehicle-damage.vue b/src/layouts/vehicle-damage/vehicle-damage.vue index 1ebbda421..3b613ad3a 100644 --- a/src/layouts/vehicle-damage/vehicle-damage.vue +++ b/src/layouts/vehicle-damage/vehicle-damage.vue @@ -93,6 +93,7 @@ import replaceOptionsQuestion from "@/layouts/vehicle-damage/replace-options-que import alert from "@/ux-components/alert/alert"; // Supporting files +import { skipVinLookup } from "@/helpers/heritage-integration/navigation-helper"; import { fetchCmsContentForPage } from "@/helpers/cms-content-helper"; import { settleAllPromises } from "@/helpers/layout-helper"; import { storeActions } from "@/constants/store-actions"; @@ -365,7 +366,7 @@ export default { return this.navigateForward(); }, - navigateForward() { + async navigateForward() { const payment = this.$store.getters.payment; const policy = this.$store.getters.policy; @@ -376,17 +377,27 @@ export default { policy.policyNumber !== ""; if (vehicleChangedDuringPolicyLookupInHeritage) { - if (store.getters.damage.isRepair) { + const skipVin = await skipVinLookup(); + + if (skipVin) { this.$router.navigateWithSaving( - this.navigationScenarios.CLICKED_FORWARD_WITH_REPAIR_AND_VERIFIED_INSURANCE, + this.navigationScenarios.CLICKED_FORWARD_WITHOUT_VIN, this.$route ); } else { - this.$router.navigateWithSaving( - this.navigationScenarios - .CLICKED_FORWARD_WITH_REPLACE_AND_VERIFIED_INSURANCE, - this.$route - ); + if (store.getters.damage.isRepair) { + this.$router.navigateWithSaving( + this.navigationScenarios + .CLICKED_FORWARD_WITH_REPAIR_AND_VERIFIED_INSURANCE, + this.$route + ); + } else { + this.$router.navigateWithSaving( + this.navigationScenarios + .CLICKED_FORWARD_WITH_REPLACE_AND_VERIFIED_INSURANCE, + this.$route + ); + } } } // If vin already exists, navigate directly to vin-lookup