diff --git a/src/constants/endpoints.js b/src/constants/endpoints.js
index 76077db76..9a105cc0f 100644
--- a/src/constants/endpoints.js
+++ b/src/constants/endpoints.js
@@ -208,6 +208,10 @@ const endpoints = {
url: "/account/api/v1/account/bill-to-account-number",
method: "GET",
},
+ GetAccountDetails: {
+ url: "/account/api/v1/account/account-details",
+ method: "GET",
+ },
ClosestApplicableShops: {
url: "/location/api/v1/location/closest-applicable-shops",
method: "GET",
diff --git a/src/constants/store-actions.js b/src/constants/store-actions.js
index a50ff4bb9..c9f78cb7b 100644
--- a/src/constants/store-actions.js
+++ b/src/constants/store-actions.js
@@ -55,6 +55,7 @@ const storeActions = {
REVALIDATE_ORDER_PROMOS_AND_SAVE_SERVER_DATA: "revalidateOrderPromosAndSaveServerData",
GET_INSURANCE_COMPANY_LIST: "getInsuranceCompanyList",
GET_BILL_TO_ACCOUNT_NUMBER: "getBillToAccountNumber",
+ GET_ACCOUNT_DETAILS: "getAccountDetails",
GET_RECAL_PARTS_AND_SAVE_TO_LINE_ITEMS: "getRecalPartsAndSaveToLineItems",
GET_CLOSEST_APPLICABLE_SHOPS: "getClosestApplicableShops",
@@ -100,8 +101,7 @@ const storeActions = {
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_INSURANCE_ACCOUNT_DETAILS: "saveInsuranceAccountDetails",
SAVE_BILL_TO_ACCOUNT_NUMBER: "saveBillToAccountNumber",
SAVE_SUPPORTING_ITEMS: "saveSupportingItems",
SAVE_SUPPORTING_ITEMS_SUPPRESSING_STATE_RESETTING:
@@ -120,6 +120,7 @@ const storeActions = {
SAVE_IS_OEM_GLASS_SELECTED: "saveIsOemGlassSelected",
SAVE_IS_MSR_FEE_APPLICABLE: "saveIsMSRFeeApplicable",
SAVE_IS_MSR_FEE_COVERED_BY_INSURANCE: "saveIsMSRFeeCoveredByInsurance",
+ SAVE_IS_NEW_INSURANCE_FLOW: "saveIsNewInsuranceFlow",
CREATE_SUBMITTED_STATE: "createSubmittedState",
RESET_SUBMITTED_STATE: "resetSubmittedState",
diff --git a/src/constants/store-mutations.js b/src/constants/store-mutations.js
index f95a397a0..d0efaf4e6 100644
--- a/src/constants/store-mutations.js
+++ b/src/constants/store-mutations.js
@@ -65,6 +65,7 @@ const storeMutations = {
UPDATE_ACCOUNT_NAME: "updateAccountName",
UPDATE_IS_CLAIM_AND_COVERAGE: "updateIsClaimAndCoverage",
UPDATE_CAN_SCHEDULE_ONLINE: "updateCanScheduleOnline",
+ UPDATE_IS_MANAGED_ACCOUNT: "updateIsManagedAccount",
UPDATE_BILL_TO_ACCT_NUMBER: "updateBillToAcctNumber",
UPDATE_EON: "updateEON",
UPDATE_IS_INSURANCE: "updateIsInsurance",
@@ -83,6 +84,7 @@ const storeMutations = {
UPDATE_IS_OEM_GLASS_SELECTED: "updateIsOemGlassSelected",
UPDATE_IS_MSR_FEE_APPLICABLE: "updateIsMSRFeeApplicable",
UPDATE_IS_MSR_FEE_COVERED_BY_INSURANCE: "updateIsMSRFeeCoveredByInsurance",
+ UPDATE_IS_NEW_INSURANCE_FLOW: "updateIsNewInsuranceFlow",
UPDATE_CASH_PRICE_SUBTOTAL: "updateCashPriceSubTotal",
// EVENT BUS MUTATIONS
diff --git a/src/fmg-components/content-group-modal/content-group-modal.vue b/src/fmg-components/content-group-modal/content-group-modal.vue
index e4a5241c4..12b4acf32 100644
--- a/src/fmg-components/content-group-modal/content-group-modal.vue
+++ b/src/fmg-components/content-group-modal/content-group-modal.vue
@@ -14,6 +14,7 @@
class="my-4 caption modal-sub-body"
v-if="ModalSubBodyText"
v-html="ModalSubBodyText">
+
@@ -58,6 +59,9 @@ export default {
ModalCloseButtonText() {
return this.getCmsContent(this.cmsWidgetName, "FooterText");
},
+ ModalFooter2Text() {
+ return this.getCmsContent(this.cmsWidgetName, "FooterText2");
+ },
},
methods: {
openModal() {
diff --git a/src/layouts/coverage-statement/coverage-statement.vue b/src/layouts/coverage-statement/coverage-statement.vue
index 6dda6fdd2..c9d9d572c 100644
--- a/src/layouts/coverage-statement/coverage-statement.vue
+++ b/src/layouts/coverage-statement/coverage-statement.vue
@@ -87,6 +87,7 @@ import modal from "@/digital-components/modal/modal";
import contentGroupModal from "@/fmg-components/content-group-modal/content-group-modal.vue";
import textBlock from "@/digital-components/text-block/text-block.vue";
import { debugLog } from "@/helpers/debug-log-helper";
+import { loadSessionIfPresent } from "@/helpers/heritage-integration/order-helper";
export default {
name: "coverage-statement",
mixins: [],
@@ -186,6 +187,13 @@ export default {
);
},
async forwardButtonAction() {
+ // The safelite api will often remove fees when switching cash to insurance. Heritage does the same.
+ // The heritage flow triggers a load session when returning to pick up new parts to make sure we're in-sync.
+ // The new insurance flow needs to trigger a load session to pick up these same type of part changes.
+ if (store.getters.order.isNewInsuranceFlow) {
+ await loadSessionIfPresent(false, this.pageName);
+ }
+
this.$router.navigateWithSaving(
this.navigationScenarios.CLICKED_FORWARD,
this.pageName
diff --git a/src/layouts/insurance-company/insurance-company.vue b/src/layouts/insurance-company/insurance-company.vue
index 81d90edf7..aac402ec0 100644
--- a/src/layouts/insurance-company/insurance-company.vue
+++ b/src/layouts/insurance-company/insurance-company.vue
@@ -122,6 +122,7 @@ export default {
accountName: this.accountNameFromStore(),
isClaimAndCoverage: this.isClaimAndCoverageFromStore(),
canScheduleOnline: this.canScheduleOnlineFromStore(),
+ isManagedAccount: this.isManagedAccountFromStore(),
},
originalList: [],
};
@@ -156,6 +157,9 @@ export default {
canScheduleOnlineFromStore() {
return store.getters.order?.payment?.canScheduleOnline;
},
+ isManagedAccountFromStore() {
+ return store.getters.order?.payment?.isManagedAccount;
+ },
arePagePrerequisitesValid() {
return store.getters.order.payment.isInsurance === true;
},
@@ -192,15 +196,24 @@ export default {
false
);
- await this.dispatchStoreAction(
- this.storeActions.SAVE_IS_CLAIM_AND_COVERAGE,
- this.selectedAccount.isClaimAndCoverage,
+ // Fetch the latest account details for the selected parent account so that
+ // routing and the saved values below reflect the current source of truth.
+ const accountDetails = await baseMixin.methods.dispatchStoreActionWithLogging(
+ storeActions.GET_ACCOUNT_DETAILS,
+ { parentAccountNumber: this.selectedAccount.parentAccountNumber },
+ "insurance-company",
false
);
+ this.selectedAccount.isManagedAccount = accountDetails.isManagedAccount;
+
await this.dispatchStoreAction(
- this.storeActions.SAVE_CAN_SCHEDULE_ONLINE,
- this.selectedAccount.canScheduleOnline,
+ this.storeActions.SAVE_INSURANCE_ACCOUNT_DETAILS,
+ {
+ isClaimAndCoverage: this.selectedAccount.isClaimAndCoverage,
+ canScheduleOnline: this.selectedAccount.canScheduleOnline,
+ isManagedAccount: this.selectedAccount.isManagedAccount,
+ },
false
);
@@ -236,6 +249,11 @@ export default {
debugLog(
`--- ${this.selectedAccount.parentAccountNumber} C&C experiment active for this parent account number, sending to vue app Policy Info page ---`
);
+ baseMixin.methods.dispatchStoreAction(
+ storeActions.SAVE_IS_NEW_INSURANCE_FLOW,
+ true,
+ false
+ );
this.$router.navigateWithSaving(
this.navigationScenarios.CLICKED_FORWARD_POLICY_INFO,
this.pageName
@@ -248,6 +266,11 @@ export default {
debugLog(
`--- ${this.selectedAccount.parentAccountNumber} C&C experiment setting is false, but is a C&C client, sending to heritage ---`
);
+ baseMixin.methods.dispatchStoreAction(
+ storeActions.SAVE_IS_NEW_INSURANCE_FLOW,
+ false,
+ false
+ );
navigateToHeritageFunnel({
shouldSaveSession: true,
pageNameToLog: this.pageName,
@@ -265,6 +288,11 @@ export default {
debugLog(
`--- ${this.selectedAccount.parentAccountNumber} Non integrated experiment setting is true, sending to vue app Insurance Details page ---`
);
+ baseMixin.methods.dispatchStoreAction(
+ storeActions.SAVE_IS_NEW_INSURANCE_FLOW,
+ true,
+ false
+ );
this.$router.navigateWithSaving(
this.navigationScenarios.CLICKED_FORWARD_NON_CLAIM_AND_COVERAGE,
this.pageName
@@ -290,6 +318,11 @@ export default {
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 ---`
);
+ baseMixin.methods.dispatchStoreAction(
+ storeActions.SAVE_IS_NEW_INSURANCE_FLOW,
+ true,
+ false
+ );
this.$router.navigateWithSaving(
this.navigationScenarios.CLICKED_FORWARD_NON_CLAIM_AND_COVERAGE,
this.pageName
@@ -297,6 +330,11 @@ export default {
return;
}
+ baseMixin.methods.dispatchStoreAction(
+ storeActions.SAVE_IS_NEW_INSURANCE_FLOW,
+ false,
+ false
+ );
navigateToHeritageFunnel({
shouldSaveSession: true,
pageNameToLog: "insurance-company",
diff --git a/src/layouts/insurance-details/insurance-details.vue b/src/layouts/insurance-details/insurance-details.vue
index 72978f784..6414d33de 100644
--- a/src/layouts/insurance-details/insurance-details.vue
+++ b/src/layouts/insurance-details/insurance-details.vue
@@ -57,7 +57,7 @@
:questionText="damageTypesQuestionText"
class="mb-4"
v-model="damageCause"
- cmsWidgetName="DamageTypesWidget"
+ :cmsWidgetName="damageTypesWidgetName"
customDropdownId="damageTypes"
:options="damageTypesOptions"
:valueAsKey="true"
@@ -183,6 +183,7 @@ export default {
policyZip: this.getPolicyZipFromStore(),
claimNumber: this.getClaimNumberFromStore(),
showSaveProgressModal: null,
+ isManagedAccount: this.getIsManagedAccountFromStore(),
};
},
components: {
@@ -249,13 +250,22 @@ export default {
stateOptions() {
return stateOptionsInternational;
},
+ damageTypesWidgetName() {
+ return this.isManagedAccount ? "DamageTypesWidget" : "UnmanagedDamageTypesWidget";
+ },
damageCauseQuestionText() {
- return this.getCmsContent("DamageTypesWidget", "QuestionText");
+ if (this.isManagedAccount) {
+ return this.getCmsContent("DamageTypesWidget", "QuestionText");
+ } else {
+ return this.getCmsContent("UnmanagedDamageTypesWidget", "QuestionText");
+ }
},
damageTypesOptions() {
const options = {};
- const answers = this.getCmsContent("DamageTypesWidget", "Answers");
+ const answers = this.isManagedAccount
+ ? this.getCmsContent("DamageTypesWidget", "Answers")
+ : this.getCmsContent("UnmanagedDamageTypesWidget", "Answers");
if (!Array.isArray(answers)) {
return options;
}
@@ -267,6 +277,9 @@ export default {
},
},
methods: {
+ getIsManagedAccountFromStore() {
+ return store.getters.order?.payment?.isManagedAccount ?? false;
+ },
getInsuranceCompanyNameFromStore() {
return store.getters.order.policy.insuranceCompanyName;
},
diff --git a/src/layouts/quote/quote.vue b/src/layouts/quote/quote.vue
index 206ff2050..7c06d9ea4 100644
--- a/src/layouts/quote/quote.vue
+++ b/src/layouts/quote/quote.vue
@@ -777,6 +777,12 @@ export default {
}
},
async forwardButtonAction() {
+ baseMixin.methods.dispatchStoreAction(
+ storeActions.SAVE_IS_NEW_INSURANCE_FLOW,
+ false,
+ false
+ );
+
this.dispatchStoreAction(
this.storeActions.SAVE_PAYMENT_TYPE,
this.isInsuranceSelected,
@@ -795,12 +801,15 @@ export default {
false
);
this.dispatchStoreAction(
- this.storeActions.SAVE_IS_CLAIM_AND_COVERAGE,
- false,
+ this.storeActions.SAVE_INSURANCE_ACCOUNT_DETAILS,
+ {
+ isClaimAndCoverage: false,
+ canScheduleOnline: false,
+ isManagedAccount: false,
+ },
false
);
this.dispatchStoreAction(this.storeActions.RESET_INSURANCE_DETAILS, 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(
diff --git a/src/layouts/scheduling/inshop-scheduling-card/inshop-scheduling-card.spec.js b/src/layouts/scheduling/inshop-scheduling-card/inshop-scheduling-card.spec.js
index bfbade779..09647f4ca 100644
--- a/src/layouts/scheduling/inshop-scheduling-card/inshop-scheduling-card.spec.js
+++ b/src/layouts/scheduling/inshop-scheduling-card/inshop-scheduling-card.spec.js
@@ -243,4 +243,27 @@ describe("inshop-scheduling-card.vue", () => {
expect(wrapper.find(".inshop-scheduling-card__body").isVisible()).toBe(false);
wrapper.unmount();
});
+
+ describe("isLoading prop", () => {
+ test("shows the skeleton loader and hides real content when isLoading is true", () => {
+ const wrapper = mountComponent({ isLoading: true });
+ expect(wrapper.find("scheduling-card-loader-stub").exists()).toBe(true);
+ expect(wrapper.find(".inshop-scheduling-card__header").exists()).toBe(false);
+ wrapper.unmount();
+ });
+
+ test("hides the skeleton loader and shows real content when isLoading is false", () => {
+ const wrapper = mountComponent({ isLoading: false });
+ expect(wrapper.find("scheduling-card-loader-stub").exists()).toBe(false);
+ expect(wrapper.find(".inshop-scheduling-card__header").exists()).toBe(true);
+ wrapper.unmount();
+ });
+
+ test("defaults isLoading to false", () => {
+ const wrapper = mountComponent();
+ expect(wrapper.props("isLoading")).toBe(false);
+ expect(wrapper.find("scheduling-card-loader-stub").exists()).toBe(false);
+ wrapper.unmount();
+ });
+ });
});
diff --git a/src/layouts/scheduling/inshop-scheduling-card/inshop-scheduling-card.vue b/src/layouts/scheduling/inshop-scheduling-card/inshop-scheduling-card.vue
index 23638d9e0..a701ab54c 100644
--- a/src/layouts/scheduling/inshop-scheduling-card/inshop-scheduling-card.vue
+++ b/src/layouts/scheduling/inshop-scheduling-card/inshop-scheduling-card.vue
@@ -1,6 +1,9 @@