From cc0d97ca7522ad4de53dfa2c06ac8b125946eda0 Mon Sep 17 00:00:00 2001 From: CarlNation <32103961+CarlNation@users.noreply.github.com> Date: Thu, 14 Mar 2024 16:00:52 -0400 Subject: [PATCH] CSR-2005 CSR-2005 changes to select parent account and navigate to Heritage --- .../heritage-integration/navigation-helper.js | 5 +++++ src/helpers/heritage-integration/order-helper.js | 1 + src/layouts/insurance-company/insurance-company.vue | 12 ++++++++---- src/store/index.js | 2 ++ 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/helpers/heritage-integration/navigation-helper.js b/src/helpers/heritage-integration/navigation-helper.js index da21df752..03c5c368e 100644 --- a/src/helpers/heritage-integration/navigation-helper.js +++ b/src/helpers/heritage-integration/navigation-helper.js @@ -80,6 +80,11 @@ export async function navigateToHeritageFunnel({ shouldSaveSession, pageNameToLo heritageParms["forceEndToEndInsurance"] = true; } + // if they are going to heritage and already have a policy number then this is a nav back flow + if (store.getters.policy.policyNumber) { + heritageParms["insuranceNavBack"] = true; + } + router.navigateToExternalUrl(externalUrls.HERITAGE_FUNNEL, heritageParms); } diff --git a/src/helpers/heritage-integration/order-helper.js b/src/helpers/heritage-integration/order-helper.js index 38f4161b9..07c469ae8 100644 --- a/src/helpers/heritage-integration/order-helper.js +++ b/src/helpers/heritage-integration/order-helper.js @@ -166,6 +166,7 @@ async function saveSessionHelper( customerPortalLoginToken: savedSessionInfo.data.customerPortalLoginToken, lockToken: savedSessionInfo.data.lockToken, settledTenderAmount: savedSessionInfo.data.settledTenderAmount, + billToAccountNumber: savedSessionInfo.data.billToAccountNumber, }, false ); diff --git a/src/layouts/insurance-company/insurance-company.vue b/src/layouts/insurance-company/insurance-company.vue index e880b1534..4fa86743f 100644 --- a/src/layouts/insurance-company/insurance-company.vue +++ b/src/layouts/insurance-company/insurance-company.vue @@ -119,6 +119,7 @@ export default { return { searchableInsuranceCompanyList: [], originalList: [], + selectedParentAccount: "", }; }, methods: { @@ -142,8 +143,11 @@ export default { // Go back to Quote page this.$router.navigateWithoutSaving(this.navigationScenarios.CLICKED_BACK, this.$route); }, - forwardButtonAction() { - this.dispatchStoreAction( + async forwardButtonAction() { + // await any pending save-sessions. if you don't, we will save the new parent account into vuex and then a pending async save-session response overwrites it + await store.getters.applicationUser.saveSessionPromise; + + await this.dispatchStoreAction( this.storeActions.SAVE_PARENT_ACCOUNT_NUMBER, this.selectedParentAccount, false @@ -156,12 +160,12 @@ export default { }); }, selectParentAccountNumber(parentAccountName) { - if (!this.insuranceCompanyList) { + if (!this.searchableInsuranceCompanyList) { console.error("No insurance companies found"); return; } - var selectedItem = this.insuranceCompanyList.filter((item) => { + var selectedItem = this.searchableInsuranceCompanyList.filter((item) => { return item.accountName === parentAccountName; }); diff --git a/src/store/index.js b/src/store/index.js index 4fe96703e..e602cf209 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -1069,6 +1069,7 @@ export const actions = { customerPortalLoginToken, lockToken, settledTenderAmount, + billToAccountNumber, } ) { context.commit(storeMutations.UPDATE_REFERRAL_NUMBER, referralNumber); @@ -1084,6 +1085,7 @@ export const actions = { context.commit(storeMutations.LOCK_TOKEN, lockToken); context.commit(storeMutations.Customer_Portal_Login_Token, customerPortalLoginToken); context.commit(storeMutations.UPDATE_SETTLED_TENDER_AMOUNT, settledTenderAmount); + context.commit(storeMutations.UPDATE_BILL_TO_ACCT_NUMBER, billToAccountNumber); }, logPageView(