diff --git a/src/helpers/heritage-integration/navigation-helper.js b/src/helpers/heritage-integration/navigation-helper.js index 6da22c37c..e58dc0a3a 100644 --- a/src/helpers/heritage-integration/navigation-helper.js +++ b/src/helpers/heritage-integration/navigation-helper.js @@ -129,6 +129,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(