diff --git a/src/constants/store-actions.js b/src/constants/store-actions.js index 702f7c737..ad31474c3 100644 --- a/src/constants/store-actions.js +++ b/src/constants/store-actions.js @@ -123,6 +123,7 @@ const storeActions = { CREATE_SUBMITTED_STATE: "createSubmittedState", RESET_SUBMITTED_STATE: "resetSubmittedState", + RESET_INSURANCE_DETAILS: "resetInsuranceDetails", ADD_DONATION_TO_SUBMITTED_STATE: "addDonationToSubmittedState", RESET_EXTERNAL_PARAMETER_STATE: "resetExternalParameterState", UPDATE_EXTERNAL_PARAMETER_MMS: "updateExternalParameterMMS", diff --git a/src/constants/store-mutations.js b/src/constants/store-mutations.js index c43e737d3..e8bde83a5 100644 --- a/src/constants/store-mutations.js +++ b/src/constants/store-mutations.js @@ -100,6 +100,7 @@ const storeMutations = { RESET_SERVICE_LOCATION_MOBILE_ADDRESS: "resetServiceLocationMobileAddress", RESET_SCHEDULE: "resetSchedule", RESET_PAYMENT_METHOD_CHOICE: "resetPaymentMethodChoice", + RESET_INSURANCE_DETAILS: "resetInsuranceDetails", // OTHER MUTATIONS UPDATE_PAGE_DATA: "updatePageData", diff --git a/src/layouts/payment-method/payment-method.vue b/src/layouts/payment-method/payment-method.vue index da49aa039..b0347f581 100644 --- a/src/layouts/payment-method/payment-method.vue +++ b/src/layouts/payment-method/payment-method.vue @@ -834,11 +834,12 @@ export default { return getBoolFromString(this.$route?.query?.piaError); }, shouldDisplayUnverifiedInsuranceAlert() { - const shouldDisplayUnverifiedDeduct = experimentMixin.methods.hasSettingEqualTo( + const hasExperimentSetting = experimentMixin.methods.hasSettingEqualTo( experimentSettings.SHOW_UNVERIFIED_DEDUCT_ENTRY, "true" ); - return shouldDisplayUnverifiedDeduct; + + return hasExperimentSetting && this.isInsurance; }, // Necessary to make the watcher of lineItems work // JavaScript does not keep a record of the old value, only a reference to it's location in the memory. diff --git a/src/layouts/quote/quote.vue b/src/layouts/quote/quote.vue index d9f238733..206ff2050 100644 --- a/src/layouts/quote/quote.vue +++ b/src/layouts/quote/quote.vue @@ -799,6 +799,7 @@ export default { 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 { diff --git a/src/store/index.js b/src/store/index.js index 4f729efa3..18b34f023 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -374,6 +374,26 @@ export const mutations = { updateIsInsurance(state, isInsurance) { state.order.payment.isInsurance = isInsurance; }, + resetInsuranceDetails(state) { + state.order.payment.insuranceCoverage = { + isVerified: null, + coverageStatus: null, + coverageSubStatus: null, + coverageType: null, + coverageVerificationType: null, + }; + + state.order.policy.policyNumber = null; + state.order.policy.claimNumber = null; + state.order.policy.insuranceCompanyName = null; + state.order.policy.streetAddress = null; + state.order.policy.apartment = null; + state.order.policy.city = null; + state.order.policy.state = null; + state.order.policy.zipCode = null; + state.order.damage.dateOfLoss = null; + state.order.damage.damageCause = null; + }, updateIsPia(state, isPia) { state.order.payment.isPia = isPia; }, @@ -3116,6 +3136,9 @@ export const actions = { saveBillToAccountNumber(context, billToAccountNumber) { context.commit(storeMutations.UPDATE_BILL_TO_ACCT_NUMBER, billToAccountNumber); }, + resetInsuranceDetails(context) { + context.commit(storeMutations.RESET_INSURANCE_DETAILS); + }, saveSupportingItems(context, supportingItems) { syncLineItemIds(supportingItems, context.state.order.lineItems.supportingItems);