-
@@ -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);
},