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),
|
||||
vehicle: (storeState) => storeState.order.vehicle,
|
||||
damage: (storeState) => {
|
||||
if (storeState.submittedOrder) {
|
||||
return storeState.submittedOrder.damage;
|
||||
}
|
||||
return storeState.order.damage;
|
||||
},
|
||||
lineItems: (state) => {
|
||||
if (state.submittedOrder) {
|
||||
return state.submittedOrder.lineItems;
|
||||
}
|
||||
return state.order.lineItems;
|
||||
},
|
||||
damage: (storeState) => storeState.order.damage,
|
||||
lineItems: (state) => state.order.lineItems,
|
||||
payment: (state) => state.order.payment,
|
||||
policy: (state) => state.order.policy,
|
||||
hasExactlyOneChip: () => state.order.damage.numberOfChips === 1,
|
||||
|
|
@ -292,36 +282,22 @@ export const useMainStore = defineStore({
|
|||
isClaimAlreadyRegistered: (state) => state.order.payment.insuranceCoverage.claimNumber !== null,
|
||||
isBailout: (state) => state.applicationUser.pageData[issPageValues.BAILOUT_PAGE] != null,
|
||||
bailoutCode: (state) => state.applicationUser.pageData[issPageValues.BAILOUT_PAGE]?.bailoutCode,
|
||||
isNoComp: (s) => {
|
||||
if (s.submittedOrder) {
|
||||
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;
|
||||
},
|
||||
isNoComp: (s) => !!s.order.policy.noCoverage,
|
||||
isITAC: (state) => !!state.order.policy.isITAC,
|
||||
isUnverified: (s) => {
|
||||
let orderToUse = {};
|
||||
if (s.submittedOrder) {
|
||||
orderToUse = s.submittedOrder;
|
||||
} else orderToUse = s.order;
|
||||
const { payment, currentDeductible, policy } = orderToUse;
|
||||
const { payment, currentDeductible, policy } = s.order;
|
||||
const { policyLookupSuccessful } = policy;
|
||||
const registerClaimSuccessful = !!payment.insuranceCoverage.isVerified;
|
||||
if (!policyLookupSuccessful) {
|
||||
return true;
|
||||
}
|
||||
if (orderToUse.isNoComp && !orderToUse.issConfig.enableNoCompQuote) {
|
||||
if (s.isNoComp && !s.issConfig.enableNoCompQuote) {
|
||||
return true;
|
||||
}
|
||||
if (!orderToUse.isNoComp && currentDeductible == null) {
|
||||
if (!s.isNoComp && currentDeductible == null) {
|
||||
return true;
|
||||
}
|
||||
if (orderToUse.isClaimRegistrationRequired && !registerClaimSuccessful) {
|
||||
if (s.isClaimRegistrationRequired && !registerClaimSuccessful) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Reference in a new issue