Merge pull request #2007 from Safelite/feature/CSR-2237
Feature/csr 2237
This commit is contained in:
commit
899fdc9cc2
3 changed files with 40 additions and 17 deletions
|
|
@ -628,13 +628,16 @@ export default {
|
|||
},
|
||||
showInsuranceCoverageAs() {
|
||||
if (!this.isInsurance) return null;
|
||||
|
||||
if (this.isNoComp || this.isItac) {
|
||||
return coverageStatus.NOCOMP;
|
||||
} else {
|
||||
return this.hasSubmittedOrder()
|
||||
? this.getSubmittedOrder()?.payment.insuranceCoverage.coverageStatus
|
||||
: this.$store.getters.payment.insuranceCoverage.coverageStatus;
|
||||
}
|
||||
|
||||
if (this.$store.getters.coverageIsVerified) {
|
||||
return coverageStatus.VERIFIED;
|
||||
}
|
||||
|
||||
return coverageStatus.PENDING;
|
||||
},
|
||||
currentDeductible() {
|
||||
return this.hasSubmittedOrder()
|
||||
|
|
|
|||
|
|
@ -145,18 +145,30 @@ export default {
|
|||
includeTax
|
||||
);
|
||||
}
|
||||
|
||||
if (lineItems.supportingItems) {
|
||||
amountDue += this.getTotalPriceOfAllLineItemsAndChildParts(
|
||||
lineItems.supportingItems,
|
||||
includeTax
|
||||
);
|
||||
}
|
||||
|
||||
const order = this.hasSubmittedOrder() ? this.getSubmittedOrder() : store.getters.order;
|
||||
if (
|
||||
store.getters.coverageIsVerified &&
|
||||
!order.policy.isNoComp &&
|
||||
!order.policy.isItac
|
||||
) {
|
||||
amountDue = order.policy.currentDeductible;
|
||||
}
|
||||
|
||||
if (lineItems.vaps) {
|
||||
amountDue += this.getTotalPriceOfAllLineItemsAndChildParts(
|
||||
lineItems.vaps,
|
||||
includeTax
|
||||
);
|
||||
}
|
||||
|
||||
if (lineItems.promos) {
|
||||
amountDue += this.getTotalPriceOfAllLineItemsAndChildParts(
|
||||
lineItems.promos,
|
||||
|
|
@ -164,16 +176,6 @@ export default {
|
|||
);
|
||||
}
|
||||
|
||||
const order = this.hasSubmittedOrder() ? this.getSubmittedOrder() : store.getters.order;
|
||||
|
||||
if (
|
||||
order.payment.insuranceCoverage.isVerified &&
|
||||
!order.policy.isNoComp &&
|
||||
!order.policy.isItac
|
||||
) {
|
||||
amountDue = order.policy.currentDeductible;
|
||||
}
|
||||
|
||||
return ((amountDue * 100) / 100).toFixed(2);
|
||||
},
|
||||
getSubTotal(lineItems) {
|
||||
|
|
|
|||
|
|
@ -775,6 +775,24 @@ export const getters = {
|
|||
);
|
||||
return !!nonWindshieldItems?.length;
|
||||
},
|
||||
coverageIsVerified: (state) => {
|
||||
let order;
|
||||
if (window.sessionStorage.getItem("submittedOrder") !== null) {
|
||||
order = JSON.parse(window.sessionStorage.getItem("submittedOrder"));
|
||||
} else {
|
||||
order = state.order;
|
||||
}
|
||||
|
||||
if (
|
||||
order.payment?.insuranceCoverage?.isVerified &&
|
||||
order.policy?.currentDeductible != 9999 &&
|
||||
order.policy?.currentDeductible != 7777
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
},
|
||||
isMobileAppointment: (state) => {
|
||||
return state.order.serviceLocation.appointmentType === AppointmentTypeStrings.MOBILE;
|
||||
},
|
||||
|
|
@ -900,13 +918,13 @@ export const getters = {
|
|||
isVerifiedAndDeductibleZeroConfirmed: (state) => {
|
||||
// used as a CMS variable on /payment-method, needed for FunnelSubHeaderWidget on cart pages
|
||||
if (
|
||||
(state.order.policy.currentDeductible === 0 ||
|
||||
state.order.policy.currentDeductible > 0) &&
|
||||
state.order.payment.insuranceCoverage.coverageStatus === coverageStatus.VERIFIED &&
|
||||
state.order.policy.currentDeductible === 0 &&
|
||||
getters.coverageIsVerified(state) &&
|
||||
!state.order.policy.isNoComp
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
},
|
||||
requiresVerifiedRedirecting: (state) => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue