From ddeac7d4716c91701147a6a35fbc4a4f94f0627b Mon Sep 17 00:00:00 2001 From: CarlNation Date: Tue, 21 Apr 2026 11:33:44 -0400 Subject: [PATCH] CASH-2466 changes to support navigation to 2.0 insurance pages CASH-2466 changes to support navigation to 2.0 insurance pages --- src/constants/experiments.js | 4 + src/constants/progress-bar-mapper.js | 4 + src/constants/store-actions.js | 3 + src/constants/store-mutations.js | 3 + .../insurance-company-question.vue | 28 ++--- .../insurance-company/insurance-company.vue | 111 +++++++++++++++++- .../insurance-details/insurance-details.vue | 75 ++++++++++++ src/layouts/policy-info/policy-info.vue | 7 +- src/layouts/quote/quote.vue | 7 ++ src/mixins/experiment-mixin.js | 20 ++++ src/router/constants/navigation-scenarios.js | 2 + src/router/constants/routes.js | 4 + src/router/constants/routing-table.js | 24 +++- src/router/methods/routes.js | 2 +- src/store/index.js | 29 ++++- 15 files changed, 299 insertions(+), 24 deletions(-) create mode 100644 src/layouts/insurance-details/insurance-details.vue diff --git a/src/constants/experiments.js b/src/constants/experiments.js index 97e049df0..26c7b07ad 100644 --- a/src/constants/experiments.js +++ b/src/constants/experiments.js @@ -47,6 +47,10 @@ const experimentSettings = { USE_ADYEN_PAYMENT: "UseAdyenPayment", SHOW_UNVERIFIED_DEDUCT_ENTRY: "ShowUnverifiedDeducEntry", SERVICE_PACKAGE_ORDER: "ServicePackageOrder", + + // Claim and Coverage for 2.0 + ENABLE_NON_CLAIM_AND_COVERAGE_FLOW: "EnableNonC&CFlow", + NON_CLAIM_AND_COVERAGE_TEST_PARENT_ACCOUNT: "NonC&CTestParentAccount", }; const experimentTriggers = { diff --git a/src/constants/progress-bar-mapper.js b/src/constants/progress-bar-mapper.js index b21c6c9c7..7f0b49f8a 100644 --- a/src/constants/progress-bar-mapper.js +++ b/src/constants/progress-bar-mapper.js @@ -52,6 +52,10 @@ export const pageProgressMapper = { percent: 55, step: 2, }, + "insurance-details": { + percent: 55, + step: 2, + }, quote: { percent: 60, step: 2, diff --git a/src/constants/store-actions.js b/src/constants/store-actions.js index fff009619..0246654a5 100644 --- a/src/constants/store-actions.js +++ b/src/constants/store-actions.js @@ -99,6 +99,9 @@ const storeActions = { SAVE_PAYMENT_TYPE: "savePaymentType", SAVE_PAYMENT_METHOD_CHOICE: "savePaymentMethodChoice", SAVE_PARENT_ACCOUNT_NUMBER: "saveParentAccountNumber", + SAVE_ACCOUNT_NAME: "saveAccountName", + SAVE_IS_CLAIM_AND_COVERAGE: "saveIsClaimAndCoverage", + SAVE_CAN_SCHEDULE_ONLINE: "saveCanScheduleOnline", SAVE_BILL_TO_ACCOUNT_NUMBER: "saveBillToAccountNumber", SAVE_SUPPORTING_ITEMS: "saveSupportingItems", SAVE_SUPPORTING_ITEMS_SUPPRESSING_STATE_RESETTING: diff --git a/src/constants/store-mutations.js b/src/constants/store-mutations.js index b5a471a79..f3abae544 100644 --- a/src/constants/store-mutations.js +++ b/src/constants/store-mutations.js @@ -57,6 +57,9 @@ const storeMutations = { UPDATE_REFERRAL_DATE: "updateReferralDate", UPDATE_REFERRAL_CORRELATION_ID: "updateReferralCorrelationId", UPDATE_PARENT_ACCT_NUMBER: "updateParentAcctNumber", + UPDATE_ACCOUNT_NAME: "updateAccountName", + UPDATE_IS_CLAIM_AND_COVERAGE: "updateIsClaimAndCoverage", + UPDATE_CAN_SCHEDULE_ONLINE: "updateCanScheduleOnline", UPDATE_BILL_TO_ACCT_NUMBER: "updateBillToAcctNumber", UPDATE_EON: "updateEON", UPDATE_IS_INSURANCE: "updateIsInsurance", diff --git a/src/layouts/insurance-company/insurance-company-question.vue b/src/layouts/insurance-company/insurance-company-question.vue index 4d33661c8..c0ce6a2cc 100644 --- a/src/layouts/insurance-company/insurance-company-question.vue +++ b/src/layouts/insurance-company/insurance-company-question.vue @@ -35,7 +35,7 @@ export default { name: "insurance-company-question", props: { originalList: Array, - modelValue: String, + modelValue: Object, validationRules: String, }, data() { @@ -44,12 +44,13 @@ export default { }; }, computed: { - selectedAccountNumber: { + selectedAccount: { get: function () { - return this.modelValue?.toString(); + return this.modelValue; }, set: function (newValue) { - this.$emit("update:modelValue", newValue); // send data up to v-model on parent, s/b account number + this.selectedAccountName = newValue?.accountName; + this.$emit("update:modelValue", newValue); }, }, searchableInsuranceCompanyList() { @@ -71,15 +72,15 @@ export default { }, }, methods: { - getParentAccountNumber(name) { + getAccount(name) { const matchedItems = this.searchableInsuranceCompanyList?.filter((item) => { return item.accountName?.toString() === name.toString(); }); if (matchedItems.length > 0) { - return matchedItems[0].parentAccountNumber; + return matchedItems[0]; } else { - console.error("Error locating accountNumber"); + console.error("Error locating accountNumber" + name); return; } }, @@ -91,7 +92,7 @@ export default { if (matchedItems.length > 0) { return matchedItems[0].accountName; } else { - console.error("Error locating accountName"); + console.error("Error locating accountName" + number); return; } }, @@ -128,19 +129,18 @@ export default { console.error("No insurance companies found"); return; } + if (parentAccountName) { - const parentAccountNumber = this.getParentAccountNumber(parentAccountName); - this.selectedAccountNumber = parentAccountNumber; - this.selectedAccountName = this.getParentAccountName(parentAccountNumber); + this.selectedAccount = this.getAccount(parentAccountName); } else { - this.selectedAccountNumber = ""; this.selectedAccountName = ""; } }, }, mounted() { - if (this.modelValue.length > 0) { - this.selectedAccountName = this.getParentAccountName(this.modelValue?.toString()); + const parentAccountNumber = this.modelValue?.parentAccountNumber; + if (parentAccountNumber && parentAccountNumber.length > 0) { + this.selectedAccountName = this.getParentAccountName(parentAccountNumber.toString()); } const select = this.selectInsuranceCompany; diff --git a/src/layouts/insurance-company/insurance-company.vue b/src/layouts/insurance-company/insurance-company.vue index 1455847bd..c97a8589a 100644 --- a/src/layouts/insurance-company/insurance-company.vue +++ b/src/layouts/insurance-company/insurance-company.vue @@ -6,11 +6,10 @@
-
@@ -59,6 +58,7 @@ import store from "@/store"; import { flushSaveSessionQueue } from "@/helpers/heritage-integration/order-helper"; import { errorMessages } from "@/constants/error-messages"; import { required, regex } from "@/helpers/validation-rules"; +import { debugLog } from "@/helpers/debug-log-helper"; defineRule("insurance-company-required", required(errorMessages.INSURANCE_COMPANY_REQUIRED)); @@ -117,13 +117,18 @@ export default { data() { return { - parentAccountNumber: this.parentAccountNumberFromStore(), + selectedAccount: { + parentAccountNumber: this.parentAccountNumberFromStore(), + accountName: this.accountNameFromStore(), + isClaimAndCoverage: this.isClaimAndCoverageFromStore(), + canScheduleOnline: this.canScheduleOnlineFromStore(), + }, originalList: [], }; }, computed: { isParentAccountNumber() { - return !!this.parentAccountNumber; + return !!this.selectedAccount.parentAccountNumber; }, payWithCashButtonCopy() { return this.getCmsContent("PayWithCashWidget", "Text"); @@ -142,6 +147,15 @@ export default { : ""; return accountNumber; }, + accountNameFromStore() { + return store.getters.order?.payment?.accountName; + }, + isClaimAndCoverageFromStore() { + return store.getters.order?.payment?.isClaimAndCoverage; + }, + canScheduleOnlineFromStore() { + return store.getters.order?.payment?.canScheduleOnline; + }, arePagePrerequisitesValid() { return store.getters.order.payment.isInsurance === true; }, @@ -168,7 +182,25 @@ export default { await this.dispatchStoreAction( this.storeActions.SAVE_PARENT_ACCOUNT_NUMBER, - this.parentAccountNumber.toString(), + this.selectedAccount.parentAccountNumber.toString(), + false + ); + + await this.dispatchStoreAction( + this.storeActions.SAVE_ACCOUNT_NAME, + this.selectedAccount.accountName, + false + ); + + await this.dispatchStoreAction( + this.storeActions.SAVE_IS_CLAIM_AND_COVERAGE, + this.selectedAccount.isClaimAndCoverage, + false + ); + + await this.dispatchStoreAction( + this.storeActions.SAVE_CAN_SCHEDULE_ONLINE, + this.selectedAccount.canScheduleOnline, false ); @@ -187,6 +219,75 @@ export default { //Reload page when navigate with browser back button window.addEventListener("pageshow", this.handlePageShow); + //TODO: Where to send if can schedule online is false? + if (!this.selectedAccount.canScheduleOnline) { + debugLog( + `--- ${this.selectedAccount.parentAccountNumber} Can schedule online is false, sending to vue app Insurance Details page ---` + ); + } + + // hasClaimAndCoverage in experiment-mixin.js checks if the parent account number is in the experiment settings. + const isClaimAndCoverageExperimentActive = this.hasClaimAndCoverage( + this.selectedAccount.parentAccountNumber + ); + + // C&C experiment active for this parent account number, send to vue app Policy Info page + if (isClaimAndCoverageExperimentActive) { + debugLog( + `--- ${this.selectedAccount.parentAccountNumber} C&C experiment active for this parent account number, sending to vue app Policy Info page ---` + ); + this.$router.navigateWithSaving( + this.navigationScenarios.CLICKED_FORWARD_POLICY_INFO, + this.pageName + ); + return; + } + + // C&C experiment setting is false, but is a C&C client, send to heritage + if (this.selectedAccount.isClaimAndCoverage) { + debugLog( + `--- ${this.selectedAccount.parentAccountNumber} C&C experiment setting is false, but is a C&C client, sending to heritage ---` + ); + navigateToHeritageFunnel({ + shouldSaveSession: true, + pageNameToLog: this.pageName, + }); + return; + } + + // Non integrated experiment setting is true, send to new insurance details page + if ( + this.hasSettingEqualTo( + experimentSettings.ENABLE_NON_CLAIM_AND_COVERAGE_FLOW, + "true" + ) + ) { + debugLog( + `--- ${this.selectedAccount.parentAccountNumber} Non integrated experiment setting is true, sending to vue app Insurance Details page ---` + ); + this.$router.navigateWithSaving( + this.navigationScenarios.CLICKED_FORWARD_NON_CLAIM_AND_COVERAGE, + this.pageName + ); + return; + } + + // Non integrated experiment setting is false, but a parent account is NON_CLAIM_AND_COVERAGE_TEST_PARENT_ACCOUNT experiment + // contains a specific parent account number you wish to send to the veu app insurance details page + var nonIntegratedTestParentAccount = this.getSettingValue( + experimentSettings.NON_CLAIM_AND_COVERAGE_TEST_PARENT_ACCOUNT + ); + if (nonIntegratedTestParentAccount === this.selectedAccount.parentAccountNumber) { + debugLog( + `--- ${this.selectedAccount.parentAccountNumber} Non integrated experiment setting is false, but a parent account is NON_CLAIM_AND_COVERAGE_TEST_PARENT_ACCOUNT experiment contains a specific parent account number, sending to vue app Insurance Details page ---` + ); + this.$router.navigateWithSaving( + this.navigationScenarios.CLICKED_FORWARD_NON_CLAIM_AND_COVERAGE, + this.pageName + ); + return; + } + navigateToHeritageFunnel({ shouldSaveSession: true, pageNameToLog: "insurance-company", diff --git a/src/layouts/insurance-details/insurance-details.vue b/src/layouts/insurance-details/insurance-details.vue new file mode 100644 index 000000000..47db3b136 --- /dev/null +++ b/src/layouts/insurance-details/insurance-details.vue @@ -0,0 +1,75 @@ + + + diff --git a/src/layouts/policy-info/policy-info.vue b/src/layouts/policy-info/policy-info.vue index d1a9b80d2..73f94448f 100644 --- a/src/layouts/policy-info/policy-info.vue +++ b/src/layouts/policy-info/policy-info.vue @@ -58,8 +58,11 @@ export default { }, methods: { - async backButtonAction() { - // Stub, for navigating back via nav-bar. + backButtonAction() { + this.$router.navigateWithoutSaving( + this.navigationScenarios.CLICKED_BACK, + this.pageName + ); }, async forwardButtonAction() { // Stub, for navigating forward via nav-bar diff --git a/src/layouts/quote/quote.vue b/src/layouts/quote/quote.vue index 106c04bfa..ab253627c 100644 --- a/src/layouts/quote/quote.vue +++ b/src/layouts/quote/quote.vue @@ -792,6 +792,13 @@ export default { applicationConfig.CASH_DEFAULT_BILL_TO_ACCOUNT_NUMBER, false ); + this.dispatchStoreAction( + this.storeActions.SAVE_IS_CLAIM_AND_COVERAGE, + false, + false + ); + this.dispatchStoreAction(this.storeActions.SAVE_CAN_SCHEDULE_ONLINE, false, false); + this.dispatchStoreAction(this.storeActions.SAVE_ACCOUNT_NAME, null, false); } else { baseMixin.methods.dispatchStoreAction( storeActions.SAVE_PARENT_ACCOUNT_NUMBER, diff --git a/src/mixins/experiment-mixin.js b/src/mixins/experiment-mixin.js index 474945a54..9439f0506 100644 --- a/src/mixins/experiment-mixin.js +++ b/src/mixins/experiment-mixin.js @@ -1,5 +1,6 @@ import store from "@/store"; import * as experimentHelper from "../helpers/experiment-helper"; +import { experimentSettings } from "@/constants/experiments"; /* This is a wrapper around experiment-helper.js methods that allows an override @@ -32,5 +33,24 @@ export default { experimentHelper.getExperimentSettingsFromExperimentList(experimentList); return experimentHelper.getSettingValue(settingName, experimentSettings); }, + + // Looks for an experiment setting that has a value that matches the passed in parent account number. + // Settings named NON_CLAIM_AND_COVERAGE_TEST_PARENT_ACCOUNT are excluded from the match. + hasClaimAndCoverage( + parentAccountNumber, + experimentList = store.getters.applicationUser.experiments + ) { + const parentNum = String(parentAccountNumber); + return experimentList.some( + (experiment) => + experiment.settings && + Object.entries(experiment.settings).some( + ([name, value]) => + name !== + experimentSettings.NON_CLAIM_AND_COVERAGE_TEST_PARENT_ACCOUNT && + value === parentNum + ) + ); + }, }, }; diff --git a/src/router/constants/navigation-scenarios.js b/src/router/constants/navigation-scenarios.js index 21bcc46f3..6fe7df27a 100644 --- a/src/router/constants/navigation-scenarios.js +++ b/src/router/constants/navigation-scenarios.js @@ -48,6 +48,8 @@ const navigationScenarios = { // Insurance-Company CLICKED_PAY_ON_MY_OWN: "CLICKED_PAY_ON_MY_OWN", + CLICKED_FORWARD_POLICY_INFO: "CLICKED_FORWARD_POLICY_INFO", + CLICKED_FORWARD_NON_CLAIM_AND_COVERAGE: "CLICKED_FORWARD_NON_CLAIM_AND_COVERAGE", //Service-Location CLICKED_FORWARD_WITH_MOBILE_SERVICE: "CLICKED_FORWARD_WITH_MOBILE_SERVICE", diff --git a/src/router/constants/routes.js b/src/router/constants/routes.js index 47c37bb55..c905c800c 100644 --- a/src/router/constants/routes.js +++ b/src/router/constants/routes.js @@ -55,6 +55,10 @@ export const routeData = { name: "policy-info", path: "/policy-info", }, + INSURANCE_DETAILS: { + name: "insurance-details", + path: "/insurance-details", + }, INSURANCE_COMPANY: { name: "insurance-company", path: "/insurance-company", diff --git a/src/router/constants/routing-table.js b/src/router/constants/routing-table.js index a7be5f387..a225e2651 100644 --- a/src/router/constants/routing-table.js +++ b/src/router/constants/routing-table.js @@ -431,7 +431,21 @@ const routingTable = function () { }, { pageName: routeData.POLICY_INFO.name, - maps: [], + maps: [ + { + scenario: navigationScenarios.CLICKED_BACK, + destinationPageData: routeData.INSURANCE_COMPANY, + }, + ], + }, + { + pageName: routeData.INSURANCE_DETAILS.name, + maps: [ + { + scenario: navigationScenarios.CLICKED_BACK, + destinationPageData: routeData.INSURANCE_COMPANY, + }, + ], }, { pageName: routeData.INSURANCE_COMPANY.name, @@ -451,6 +465,14 @@ const routingTable = function () { scenario: navigationScenarios.CLICKED_FORWARD, destinationPageData: routeData.INSURANCE_DETAILS, }, + { + scenario: navigationScenarios.CLICKED_FORWARD_POLICY_INFO, + destinationPageData: routeData.POLICY_INFO, + }, + { + scenario: navigationScenarios.CLICKED_FORWARD_NON_CLAIM_AND_COVERAGE, + destinationPageData: routeData.INSURANCE_DETAILS, + }, ], }, // TODO: REMOVE THIS COMMENT AND BELOW, ONCE CASH-803 (SERVICE-LOCATION AND SCHEDULE PAGE COMBINATION) HAS BEEN VETTED diff --git a/src/router/methods/routes.js b/src/router/methods/routes.js index 521ba43a1..8870ac418 100644 --- a/src/router/methods/routes.js +++ b/src/router/methods/routes.js @@ -42,7 +42,7 @@ export const routes = [ createRoute(routeData.RETURN_USER), createRoute(routeData.MOBILE_DETAILS), createRoute(routeData.POLICY_INFO), - + createRoute(routeData.INSURANCE_DETAILS), // Virtual pages (resolve to a non-virtual page.) createVirtualRoute(routeData.LANDING, landingBeforeEnter), createVirtualRoute(routeData.HERITAGE, heritageBeforeEnter), diff --git a/src/store/index.js b/src/store/index.js index da45f3a61..5ee163b0b 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -142,6 +142,9 @@ const getDefaultState = () => { coverageVerificationType: null, }, parentAccountNumber: 0, + accountName: null, + isClaimAndCoverage: false, + canScheduleOnline: false, billToAccountNumber: null, isPia: null, piaType: null, @@ -328,6 +331,16 @@ export const mutations = { updateParentAcctNumber(state, parentAcctNumber) { state.order.payment.parentAccountNumber = parentAcctNumber; }, + updateAccountName(state, accountName) { + state.order.payment.accountName = accountName; + state.order.policy.insuranceCompanyName = accountName; + }, + updateIsClaimAndCoverage(state, isClaimAndCoverage) { + state.order.payment.isClaimAndCoverage = isClaimAndCoverage; + }, + updateCanScheduleOnline(state, canScheduleOnline) { + state.order.payment.canScheduleOnline = canScheduleOnline; + }, updateBillToAcctNumber(state, billToAcctNumber) { state.order.payment.billToAccountNumber = billToAcctNumber; }, @@ -766,7 +779,10 @@ export const mutations = { state.order.payment.billToAccountNumber = sessionInformation.order.payment.billToAccountNumber; state.order.payment.inactivePromos = sessionInformation.order.payment.inactivePromos; - + state.order.payment.isClaimAndCoverage = + sessionInformation.order.payment.isClaimAndCoverage; + state.order.payment.canScheduleOnline = sessionInformation.order.payment.canScheduleOnline; + state.order.payment.accountName = sessionInformation.order.policy.insuranceCompanyName; //Do not assign default service type once user make service type selection if (state.order.serviceLocation.appointmentType == null) { state.order.serviceLocation.address = @@ -2524,6 +2540,8 @@ export const actions = { isInsurance: order.payment.isInsurance, parentAccountNumber: order.payment.parentAccountNumber, billToAccountNumber: order.payment.billToAccountNumber, + isClaimAndCoverage: order.payment.isClaimAndCoverage, + canScheduleOnline: order.payment.canScheduleOnline, inactivePromos: order.payment.inactivePromos, isCreditCard: order.payment.piaType == paymentMethods.CREDIT_CARD ? true : false, @@ -3040,6 +3058,15 @@ export const actions = { saveParentAccountNumber(context, parentAccountNumber) { context.commit(storeMutations.UPDATE_PARENT_ACCT_NUMBER, parentAccountNumber); }, + saveAccountName(context, accountName) { + context.commit(storeMutations.UPDATE_ACCOUNT_NAME, accountName); + }, + saveIsClaimAndCoverage(context, isClaimAndCoverage) { + context.commit(storeMutations.UPDATE_IS_CLAIM_AND_COVERAGE, isClaimAndCoverage); + }, + saveCanScheduleOnline(context, canScheduleOnline) { + context.commit(storeMutations.UPDATE_CAN_SCHEDULE_ONLINE, canScheduleOnline); + }, saveBillToAccountNumber(context, billToAccountNumber) { context.commit(storeMutations.UPDATE_BILL_TO_ACCT_NUMBER, billToAccountNumber); },