Removing unnecessary

This commit is contained in:
Michaela Brydon 2024-04-11 14:52:17 -04:00
parent b2cb23ca18
commit 954a089721

View file

@ -181,7 +181,8 @@ export default {
let hasBailedOut = false; let hasBailedOut = false;
let pricingResults = []; let pricingResults = [];
if (useMainStore().policy.policyLookupSuccessful && useMainStore().vehicle.policyVehicleId >= 0) { const { policy, vehicle } = useMainStore();
if (policy.policyLookupSuccessful && vehicle.policyVehicleId >= 0) {
await useMainStore().getFinalDeductible(); await useMainStore().getFinalDeductible();
pricingResults = await useMainStore().getPriceOrderItems(availableLineItems) pricingResults = await useMainStore().getPriceOrderItems(availableLineItems)
.catch((err) => { .catch((err) => {
@ -210,12 +211,7 @@ export default {
} }
}, },
data() { data() {
const { isRepair } = useMainStore().damage;
// const { policyLookupSuccessful } = useMainStore().policy;
return { return {
isRepair,
// policyLookupSuccessful,
isNoComp: useMainStore().isNoComp,
baseServiceLineItems: [], baseServiceLineItems: [],
selectedProvider: '', selectedProvider: '',
deductibleText: 'Your deductible is', deductibleText: 'Your deductible is',
@ -440,6 +436,7 @@ export default {
return processIfStatements(rawText, 'custom', this.getCustomValueFromString); return processIfStatements(rawText, 'custom', this.getCustomValueFromString);
}, },
getCustomValueFromString(str) { getCustomValueFromString(str) {
const { isRepair } = useMainStore().damage;
switch (str) { switch (str) {
case 'coverageUnverified': case 'coverageUnverified':
return this.isUnverifiedVisible; return this.isUnverifiedVisible;
@ -450,11 +447,11 @@ export default {
case 'verifiedNoComp': case 'verifiedNoComp':
return this.isNoCompQuoteVisible; return this.isNoCompQuoteVisible;
case 'ADASReplace': case 'ADASReplace':
return !this.isRepair && this.isADAS; return !isRepair && this.isADAS;
case 'nonADASReplace': case 'nonADASReplace':
return !this.isRepair && !this.isADAS; return !isRepair && !this.isADAS;
case 'nonADASRepair': case 'nonADASRepair':
return this.isRepair; return isRepair;
case 'deductibleOverZero': case 'deductibleOverZero':
return this.isDeductibleVisible && this.deductibleValue !== 0; // TODO what if deductible is negative? return this.isDeductibleVisible && this.deductibleValue !== 0; // TODO what if deductible is negative?
case 'isDeductibleZero': case 'isDeductibleZero':