commit
596a877d35
7 changed files with 44 additions and 4 deletions
|
|
@ -84,6 +84,7 @@ const storeActions = {
|
||||||
SAVE_SUPPORTING_ITEMS_SUPPRESSING_STATE_RESETTING:
|
SAVE_SUPPORTING_ITEMS_SUPPRESSING_STATE_RESETTING:
|
||||||
"saveSupportingItemsSuppressingStateResetting",
|
"saveSupportingItemsSuppressingStateResetting",
|
||||||
SAVE_VAPS: "saveVaps",
|
SAVE_VAPS: "saveVaps",
|
||||||
|
SAVE_SWITCH_INSURANCE_TO_CASH: "saveSwitchInsuranceToCash",
|
||||||
};
|
};
|
||||||
|
|
||||||
export { storeActions };
|
export { storeActions };
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,7 @@ const storeMutations = {
|
||||||
UPDATE_VAPS: "updateVaps",
|
UPDATE_VAPS: "updateVaps",
|
||||||
UPDATE_SUPPORTING_ITEMS: "updateSupportingItems",
|
UPDATE_SUPPORTING_ITEMS: "updateSupportingItems",
|
||||||
UPDATE_LINE_ITEMS_SERVER_DATA: "updateLineItemsServerData",
|
UPDATE_LINE_ITEMS_SERVER_DATA: "updateLineItemsServerData",
|
||||||
|
UPDATE_SWITCH_INSURANCE_TO_CASH: "updateSwitchInsuranceToCash",
|
||||||
|
|
||||||
UPDATE_REGISTRATION_LICENSE_PLATE: "updateRegistrationLicensePlate",
|
UPDATE_REGISTRATION_LICENSE_PLATE: "updateRegistrationLicensePlate",
|
||||||
UPDATE_REGISTRATION_ADDRESS: "updateRegistrationAddress",
|
UPDATE_REGISTRATION_ADDRESS: "updateRegistrationAddress",
|
||||||
|
|
|
||||||
|
|
@ -63,6 +63,7 @@ export async function navigateToHeritageFunnel({ shouldSaveSession = true, loadi
|
||||||
src: "concept-funnel",
|
src: "concept-funnel",
|
||||||
conceptsqid: store.getters.applicationUser.savedSessionId,
|
conceptsqid: store.getters.applicationUser.savedSessionId,
|
||||||
isInsurance: store.getters.payment.isInsurance,
|
isInsurance: store.getters.payment.isInsurance,
|
||||||
|
switchInsuranceToCash: store.getters.order.switchInsuranceToCash,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -162,6 +162,11 @@ describe("quote.vue", () => {
|
||||||
},
|
},
|
||||||
referralNumber: "1234567",
|
referralNumber: "1234567",
|
||||||
},
|
},
|
||||||
|
payment: {
|
||||||
|
insuranceCoverage: {
|
||||||
|
isVerified: false,
|
||||||
|
},
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
let arePagePrerequisitesValid = wrapper.vm.arePagePrerequisitesValid();
|
let arePagePrerequisitesValid = wrapper.vm.arePagePrerequisitesValid();
|
||||||
|
|
@ -185,6 +190,11 @@ describe("quote.vue", () => {
|
||||||
glassParts: ["item", "item2"],
|
glassParts: ["item", "item2"],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
payment: {
|
||||||
|
insuranceCoverage: {
|
||||||
|
isVerified: false,
|
||||||
|
},
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
let arePagePrerequisitesValid = wrapper.vm.arePagePrerequisitesValid();
|
let arePagePrerequisitesValid = wrapper.vm.arePagePrerequisitesValid();
|
||||||
|
|
|
||||||
|
|
@ -150,7 +150,7 @@ export default {
|
||||||
(store.getters.order.damage.isRepair ||
|
(store.getters.order.damage.isRepair ||
|
||||||
(store.getters.order.lineItems?.glassParts != null &&
|
(store.getters.order.lineItems?.glassParts != null &&
|
||||||
store.getters.order.lineItems.glassParts.length > 0)) &&
|
store.getters.order.lineItems.glassParts.length > 0)) &&
|
||||||
store.getters.order.referralNumber?.length !== 6
|
!store.getters.payment.insuranceCoverage.isVerified
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
getDefaultIsInsuranceSelectedValue(availableLineItems) {
|
getDefaultIsInsuranceSelectedValue(availableLineItems) {
|
||||||
|
|
@ -177,6 +177,27 @@ export default {
|
||||||
vehicleQuestionsMixin.methods.navigateBack(this);
|
vehicleQuestionsMixin.methods.navigateBack(this);
|
||||||
},
|
},
|
||||||
forwardButtonAction() {
|
forwardButtonAction() {
|
||||||
|
// if referral is 6 digits unverified it indicates they were previously insurance and been to heritage
|
||||||
|
// need to set an indicator for heritage if they switched from insurance to cash. many things to reset on the referral in heritage if so
|
||||||
|
const prevPayment = this.$store.getters.payment;
|
||||||
|
if (
|
||||||
|
this.$store.getters.order.referralNumber?.length === 6 &&
|
||||||
|
!prevPayment.insuranceCoverage.isVerified &&
|
||||||
|
prevPayment.isInsurance
|
||||||
|
) {
|
||||||
|
this.dispatchStoreAction(
|
||||||
|
this.storeActions.SAVE_SWITCH_INSURANCE_TO_CASH,
|
||||||
|
true,
|
||||||
|
false
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
this.dispatchStoreAction(
|
||||||
|
this.storeActions.SAVE_SWITCH_INSURANCE_TO_CASH,
|
||||||
|
false,
|
||||||
|
false
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
this.dispatchStoreAction(
|
this.dispatchStoreAction(
|
||||||
this.storeActions.SAVE_PAYMENT_TYPE,
|
this.storeActions.SAVE_PAYMENT_TYPE,
|
||||||
this.isInsuranceSelected,
|
this.isInsuranceSelected,
|
||||||
|
|
|
||||||
|
|
@ -446,9 +446,7 @@ export default {
|
||||||
|
|
||||||
const payment = store.getters.payment;
|
const payment = store.getters.payment;
|
||||||
|
|
||||||
if (store.getters.order.referralNumber?.length === 6) {
|
if (payment.isInsurance && payment.insuranceCoverage.isVerified) {
|
||||||
navigateToHeritageFunnel({ loadingModal: self.$refs.loadingModal });
|
|
||||||
} else if (payment.isInsurance && payment.insuranceCoverage.isVerified) {
|
|
||||||
navigateToHeritageFunnel({ loadingModal: self.$refs.loadingModal });
|
navigateToHeritageFunnel({ loadingModal: self.$refs.loadingModal });
|
||||||
} else {
|
} else {
|
||||||
self.$router.navigateWithSaving(
|
self.$router.navigateWithSaving(
|
||||||
|
|
|
||||||
|
|
@ -95,6 +95,7 @@ const getDefaultState = () => {
|
||||||
referralDate: null,
|
referralDate: null,
|
||||||
referralCorrelationId: null,
|
referralCorrelationId: null,
|
||||||
eon: null,
|
eon: null,
|
||||||
|
switchInsuranceToCash: false,
|
||||||
},
|
},
|
||||||
applicationUser: {
|
applicationUser: {
|
||||||
eventBus: [],
|
eventBus: [],
|
||||||
|
|
@ -280,6 +281,9 @@ export const mutations = {
|
||||||
state.order.schedule.jobMaxMinutes = scheduleInfo.jobMaxMinutes;
|
state.order.schedule.jobMaxMinutes = scheduleInfo.jobMaxMinutes;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
updateSwitchInsuranceToCash(state, switchValue) {
|
||||||
|
state.order.switchInsuranceToCash = switchValue;
|
||||||
|
},
|
||||||
|
|
||||||
// applicationUser MUTATIONS
|
// applicationUser MUTATIONS
|
||||||
updateSaveSessionPromise(state, saveSessionPromise) {
|
updateSaveSessionPromise(state, saveSessionPromise) {
|
||||||
|
|
@ -1867,6 +1871,10 @@ export const actions = {
|
||||||
context.commit(storeMutations.UPDATE_VAPS, vaps);
|
context.commit(storeMutations.UPDATE_VAPS, vaps);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
saveSwitchInsuranceToCash(context, switchValue) {
|
||||||
|
context.commit(storeMutations.UPDATE_SWITCH_INSURANCE_TO_CASH, switchValue);
|
||||||
|
},
|
||||||
|
|
||||||
// Price order actions
|
// Price order actions
|
||||||
async priceOrderItemsAndSaveServerData(
|
async priceOrderItemsAndSaveServerData(
|
||||||
context,
|
context,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue