revert store getters changes
This commit is contained in:
parent
3cba89f728
commit
678b2e1730
1 changed files with 8 additions and 32 deletions
|
|
@ -267,18 +267,8 @@ export const useMainStore = defineStore({
|
||||||
},
|
},
|
||||||
hasRecalibrationPart: (storeState) => getHasRecalibrationPart(storeState),
|
hasRecalibrationPart: (storeState) => getHasRecalibrationPart(storeState),
|
||||||
vehicle: (storeState) => storeState.order.vehicle,
|
vehicle: (storeState) => storeState.order.vehicle,
|
||||||
damage: (storeState) => {
|
damage: (storeState) => storeState.order.damage,
|
||||||
if (storeState.submittedOrder) {
|
lineItems: (state) => state.order.lineItems,
|
||||||
return storeState.submittedOrder.damage;
|
|
||||||
}
|
|
||||||
return storeState.order.damage;
|
|
||||||
},
|
|
||||||
lineItems: (state) => {
|
|
||||||
if (state.submittedOrder) {
|
|
||||||
return state.submittedOrder.lineItems;
|
|
||||||
}
|
|
||||||
return state.order.lineItems;
|
|
||||||
},
|
|
||||||
payment: (state) => state.order.payment,
|
payment: (state) => state.order.payment,
|
||||||
policy: (state) => state.order.policy,
|
policy: (state) => state.order.policy,
|
||||||
hasExactlyOneChip: () => state.order.damage.numberOfChips === 1,
|
hasExactlyOneChip: () => state.order.damage.numberOfChips === 1,
|
||||||
|
|
@ -292,36 +282,22 @@ export const useMainStore = defineStore({
|
||||||
isClaimAlreadyRegistered: (state) => state.order.payment.insuranceCoverage.claimNumber !== null,
|
isClaimAlreadyRegistered: (state) => state.order.payment.insuranceCoverage.claimNumber !== null,
|
||||||
isBailout: (state) => state.applicationUser.pageData[issPageValues.BAILOUT_PAGE] != null,
|
isBailout: (state) => state.applicationUser.pageData[issPageValues.BAILOUT_PAGE] != null,
|
||||||
bailoutCode: (state) => state.applicationUser.pageData[issPageValues.BAILOUT_PAGE]?.bailoutCode,
|
bailoutCode: (state) => state.applicationUser.pageData[issPageValues.BAILOUT_PAGE]?.bailoutCode,
|
||||||
isNoComp: (s) => {
|
isNoComp: (s) => !!s.order.policy.noCoverage,
|
||||||
if (s.submittedOrder) {
|
isITAC: (state) => !!state.order.policy.isITAC,
|
||||||
return !!s.submittedOrder.policy.noCoverage;
|
|
||||||
}
|
|
||||||
return !!s.order.policy.noCoverage;
|
|
||||||
},
|
|
||||||
isITAC: (state) => {
|
|
||||||
if (state.submittedOrder) {
|
|
||||||
return !!state.submittedOrder.policy.isITAC;
|
|
||||||
}
|
|
||||||
return !!state.order.policy.isITAC;
|
|
||||||
},
|
|
||||||
isUnverified: (s) => {
|
isUnverified: (s) => {
|
||||||
let orderToUse = {};
|
const { payment, currentDeductible, policy } = s.order;
|
||||||
if (s.submittedOrder) {
|
|
||||||
orderToUse = s.submittedOrder;
|
|
||||||
} else orderToUse = s.order;
|
|
||||||
const { payment, currentDeductible, policy } = orderToUse;
|
|
||||||
const { policyLookupSuccessful } = policy;
|
const { policyLookupSuccessful } = policy;
|
||||||
const registerClaimSuccessful = !!payment.insuranceCoverage.isVerified;
|
const registerClaimSuccessful = !!payment.insuranceCoverage.isVerified;
|
||||||
if (!policyLookupSuccessful) {
|
if (!policyLookupSuccessful) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (orderToUse.isNoComp && !orderToUse.issConfig.enableNoCompQuote) {
|
if (s.isNoComp && !s.issConfig.enableNoCompQuote) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!orderToUse.isNoComp && currentDeductible == null) {
|
if (!s.isNoComp && currentDeductible == null) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (orderToUse.isClaimRegistrationRequired && !registerClaimSuccessful) {
|
if (s.isClaimRegistrationRequired && !registerClaimSuccessful) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue