Adding is unverified to store
This commit is contained in:
parent
954a089721
commit
beadf916a2
4 changed files with 22 additions and 17 deletions
|
|
@ -212,12 +212,6 @@ export default {
|
||||||
baseServicePrice() {
|
baseServicePrice() {
|
||||||
return getPriceOfLineItems(this.baseServiceLineItems) ?? 0;
|
return getPriceOfLineItems(this.baseServiceLineItems) ?? 0;
|
||||||
},
|
},
|
||||||
// TODO update tests
|
|
||||||
isUnverified() {
|
|
||||||
return (useMainStore().isNoComp && !useMainStore().issConfig.enableNoCompQuote)
|
|
||||||
|| (!useMainStore().isNoComp && !useMainStore().isITAC
|
|
||||||
&& (this.deductible == null || !useMainStore().isVerifiedCoverageStatus));
|
|
||||||
},
|
|
||||||
subTotal() {
|
subTotal() {
|
||||||
const { supportingItems, glassParts, otherParts, vaps, mobileFee } = useMainStore().lineItems;
|
const { supportingItems, glassParts, otherParts, vaps, mobileFee } = useMainStore().lineItems;
|
||||||
const allLineItems = [
|
const allLineItems = [
|
||||||
|
|
@ -249,7 +243,7 @@ export default {
|
||||||
|
|
||||||
let result = 0;
|
let result = 0;
|
||||||
|
|
||||||
if (!this.isUnverified) {
|
if (!useMainStore().isUnverified) {
|
||||||
if (useMainStore().isITAC || useMainStore().isNoComp) {
|
if (useMainStore().isITAC || useMainStore().isNoComp) {
|
||||||
result += sumTax(this.baseServiceLineItems);
|
result += sumTax(this.baseServiceLineItems);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -413,7 +407,7 @@ export default {
|
||||||
this.isExpanded = !this.isExpanded;
|
this.isExpanded = !this.isExpanded;
|
||||||
},
|
},
|
||||||
getDisplayed(amount) {
|
getDisplayed(amount) {
|
||||||
return this.isUnverified
|
return useMainStore().isUnverified
|
||||||
? VERIFYING_COVERAGE
|
? VERIFYING_COVERAGE
|
||||||
: formatAmountInDollars(amount);
|
: formatAmountInDollars(amount);
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -177,13 +177,7 @@ export default {
|
||||||
const piaExperience = this.getSettingValue(experimentSettings.ISS_DISPLAY_PAY_IN_ADVANCE);
|
const piaExperience = this.getSettingValue(experimentSettings.ISS_DISPLAY_PAY_IN_ADVANCE);
|
||||||
const isEnabled = piaExperience === 'true';
|
const isEnabled = piaExperience === 'true';
|
||||||
|
|
||||||
return !isEnabled || this.isUnverified;
|
return !isEnabled || useMainStore().isUnverified;
|
||||||
},
|
|
||||||
isUnverified() {
|
|
||||||
return (useMainStore().isNoComp && !useMainStore().issConfig.enableNoCompQuote)
|
|
||||||
|| (!useMainStore().isNoComp
|
|
||||||
&& !useMainStore().isITAC
|
|
||||||
&& (useMainStore().order.currentDeductible == null || !useMainStore().isVerifiedCoverageStatus));
|
|
||||||
},
|
},
|
||||||
paymentMethod() {
|
paymentMethod() {
|
||||||
return this.paymentMethodInternalModel;
|
return this.paymentMethodInternalModel;
|
||||||
|
|
|
||||||
|
|
@ -192,8 +192,7 @@ export default {
|
||||||
return this.getCmsContent(this.widget.footer, widgetFields.FOOTER_WIDGET.FORWARD_BUTTON_TEXT);
|
return this.getCmsContent(this.widget.footer, widgetFields.FOOTER_WIDGET.FORWARD_BUTTON_TEXT);
|
||||||
},
|
},
|
||||||
isVerified() {
|
isVerified() {
|
||||||
return !(useMainStore().isNoComp && !useMainStore().enableNoCompQuote)
|
return useMainStore().order.payment.insuranceCoverage.isVerified;
|
||||||
&& useMainStore().order.payment.insuranceCoverage.isVerified;
|
|
||||||
},
|
},
|
||||||
currentDeductible() {
|
currentDeductible() {
|
||||||
return useMainStore().order.currentDeductible;
|
return useMainStore().order.currentDeductible;
|
||||||
|
|
|
||||||
|
|
@ -268,6 +268,24 @@ export const useMainStore = defineStore({
|
||||||
bailoutCode: (state) => state.applicationUser.pageData[issPageValues.BAILOUT_PAGE]?.bailoutCode,
|
bailoutCode: (state) => state.applicationUser.pageData[issPageValues.BAILOUT_PAGE]?.bailoutCode,
|
||||||
isNoComp: (s) => !!s.order.policy.noCoverage,
|
isNoComp: (s) => !!s.order.policy.noCoverage,
|
||||||
isITAC: (state) => !!state.order.policy.isITAC,
|
isITAC: (state) => !!state.order.policy.isITAC,
|
||||||
|
isUnverified: (s) => {
|
||||||
|
const { policyLookupSuccessful, payment, currentDeductible } = s.order;
|
||||||
|
const registerClaimSuccessful = payment.insuranceCoverage.isVerified;
|
||||||
|
if (!policyLookupSuccessful) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (s.isNoComp && !s.issConfig.enableNoCompQuote) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (!s.isNoComp && currentDeductible == null) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (s.isClaimRegistrationRequired && !registerClaimSuccessful) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
// TODO condense verification logic
|
||||||
isVerifiedCoverageStatus: (state) => state.order.payment.insuranceCoverage.coverageStatus === coverageStatuses.VERIFIED,
|
isVerifiedCoverageStatus: (state) => state.order.payment.insuranceCoverage.coverageStatus === coverageStatuses.VERIFIED,
|
||||||
eventBusItem: (state) => (eventCategory, eventSubCategory) => {
|
eventBusItem: (state) => (eventCategory, eventSubCategory) => {
|
||||||
const matchedEvent = state.applicationUser.eventBus.find(({ category, subCategory }) => category === eventCategory && subCategory === eventSubCategory);
|
const matchedEvent = state.applicationUser.eventBus.find(({ category, subCategory }) => category === eventCategory && subCategory === eventSubCategory);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue