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() {
|
||||
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() {
|
||||
const { supportingItems, glassParts, otherParts, vaps, mobileFee } = useMainStore().lineItems;
|
||||
const allLineItems = [
|
||||
|
|
@ -249,7 +243,7 @@ export default {
|
|||
|
||||
let result = 0;
|
||||
|
||||
if (!this.isUnverified) {
|
||||
if (!useMainStore().isUnverified) {
|
||||
if (useMainStore().isITAC || useMainStore().isNoComp) {
|
||||
result += sumTax(this.baseServiceLineItems);
|
||||
} else {
|
||||
|
|
@ -413,7 +407,7 @@ export default {
|
|||
this.isExpanded = !this.isExpanded;
|
||||
},
|
||||
getDisplayed(amount) {
|
||||
return this.isUnverified
|
||||
return useMainStore().isUnverified
|
||||
? VERIFYING_COVERAGE
|
||||
: formatAmountInDollars(amount);
|
||||
},
|
||||
|
|
|
|||
|
|
@ -177,13 +177,7 @@ export default {
|
|||
const piaExperience = this.getSettingValue(experimentSettings.ISS_DISPLAY_PAY_IN_ADVANCE);
|
||||
const isEnabled = piaExperience === 'true';
|
||||
|
||||
return !isEnabled || this.isUnverified;
|
||||
},
|
||||
isUnverified() {
|
||||
return (useMainStore().isNoComp && !useMainStore().issConfig.enableNoCompQuote)
|
||||
|| (!useMainStore().isNoComp
|
||||
&& !useMainStore().isITAC
|
||||
&& (useMainStore().order.currentDeductible == null || !useMainStore().isVerifiedCoverageStatus));
|
||||
return !isEnabled || useMainStore().isUnverified;
|
||||
},
|
||||
paymentMethod() {
|
||||
return this.paymentMethodInternalModel;
|
||||
|
|
|
|||
|
|
@ -192,8 +192,7 @@ export default {
|
|||
return this.getCmsContent(this.widget.footer, widgetFields.FOOTER_WIDGET.FORWARD_BUTTON_TEXT);
|
||||
},
|
||||
isVerified() {
|
||||
return !(useMainStore().isNoComp && !useMainStore().enableNoCompQuote)
|
||||
&& useMainStore().order.payment.insuranceCoverage.isVerified;
|
||||
return useMainStore().order.payment.insuranceCoverage.isVerified;
|
||||
},
|
||||
currentDeductible() {
|
||||
return useMainStore().order.currentDeductible;
|
||||
|
|
|
|||
|
|
@ -268,6 +268,24 @@ export const useMainStore = defineStore({
|
|||
bailoutCode: (state) => state.applicationUser.pageData[issPageValues.BAILOUT_PAGE]?.bailoutCode,
|
||||
isNoComp: (s) => !!s.order.policy.noCoverage,
|
||||
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,
|
||||
eventBusItem: (state) => (eventCategory, eventSubCategory) => {
|
||||
const matchedEvent = state.applicationUser.eventBus.find(({ category, subCategory }) => category === eventCategory && subCategory === eventSubCategory);
|
||||
|
|
|
|||
Loading…
Reference in a new issue