Making adjustments based on PR comments
This commit is contained in:
parent
c696a7e82a
commit
0122a802b3
5 changed files with 20 additions and 14 deletions
5
src/constants/part-number-strings.js
Normal file
5
src/constants/part-number-strings.js
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
const partNumberStrings = Object.freeze({
|
||||||
|
RECYCLE_FEE: 'RECYCLE FEE'
|
||||||
|
});
|
||||||
|
|
||||||
|
export default partNumberStrings;
|
||||||
|
|
@ -4,7 +4,6 @@
|
||||||
RAIN_DEFENSE: 'RAIN DEFENSE',
|
RAIN_DEFENSE: 'RAIN DEFENSE',
|
||||||
RECALIBRATION: 'RECALIBRATION',
|
RECALIBRATION: 'RECALIBRATION',
|
||||||
REPLACE_FEE: 'REPLACE FEE',
|
REPLACE_FEE: 'REPLACE FEE',
|
||||||
RECYCLE_FEE: 'RECYCLE FEE',
|
|
||||||
MOBILE_FEE: 'MOBILE FEE',
|
MOBILE_FEE: 'MOBILE FEE',
|
||||||
REPAIR_FEE: 'REPAIR FEE'
|
REPAIR_FEE: 'REPAIR FEE'
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -6,8 +6,6 @@ Object {
|
||||||
"deductible": null,
|
"deductible": null,
|
||||||
"glassToReplace": Array [],
|
"glassToReplace": Array [],
|
||||||
"isExpanded": false,
|
"isExpanded": false,
|
||||||
"isITAC": false,
|
|
||||||
"isNoComp": false,
|
|
||||||
"isRepair": null,
|
"isRepair": null,
|
||||||
"vapsInOrder": Array [],
|
"vapsInOrder": Array [],
|
||||||
"widget": Object {
|
"widget": Object {
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ import { useMainStore } from '@/store';
|
||||||
import coverageStatuses from '@/constants/coverage-statuses';
|
import coverageStatuses from '@/constants/coverage-statuses';
|
||||||
import { formatAmountInDollars } from '@/helpers/text-helper.js';
|
import { formatAmountInDollars } from '@/helpers/text-helper.js';
|
||||||
import partTypeStrings from '@/constants/part-type-strings';
|
import partTypeStrings from '@/constants/part-type-strings';
|
||||||
|
import partNumberStrings from '@/constants/part-number-strings';
|
||||||
import { getHighestFullySatisfiedTier, getPackageContents } from '@/helpers/service-package-helper.js';
|
import { getHighestFullySatisfiedTier, getPackageContents } from '@/helpers/service-package-helper.js';
|
||||||
import getPriceOfLineItems from '@/helpers/price-calculator.js';
|
import getPriceOfLineItems from '@/helpers/price-calculator.js';
|
||||||
|
|
||||||
|
|
@ -187,7 +188,7 @@ describe('cart-dropdown component', () => {
|
||||||
order: {
|
order: {
|
||||||
lineItems: {
|
lineItems: {
|
||||||
supportingItems: [{
|
supportingItems: [{
|
||||||
partNumber: partTypeStrings.RECYCLE_FEE
|
partNumber: partNumberStrings.RECYCLE_FEE
|
||||||
}]
|
}]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -887,7 +888,7 @@ describe('cart-dropdown component', () => {
|
||||||
const storeData = {
|
const storeData = {
|
||||||
order: {
|
order: {
|
||||||
lineItems: {
|
lineItems: {
|
||||||
supportingItems: [{ partType: 'not recycle' }]
|
supportingItems: [{ partNumber: 'not recycle' }]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
@ -916,7 +917,7 @@ describe('cart-dropdown component', () => {
|
||||||
const storeData = {
|
const storeData = {
|
||||||
order: {
|
order: {
|
||||||
lineItems: {
|
lineItems: {
|
||||||
supportingItems: [{ partNumber: partTypeStrings.RECYCLE_FEE }]
|
supportingItems: [{ partNumber: partNumberStrings.RECYCLE_FEE }]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@
|
||||||
id="cart-deductible-or-base-price"
|
id="cart-deductible-or-base-price"
|
||||||
class="cart-item cart-gray">
|
class="cart-item cart-gray">
|
||||||
<div
|
<div
|
||||||
v-if="!isNoComp && !isITAC"
|
v-if="showDeductibleCartItem"
|
||||||
id="cart-deductible"
|
id="cart-deductible"
|
||||||
class="d-flex justify-content-between align-items-center">
|
class="d-flex justify-content-between align-items-center">
|
||||||
<span id="deductible-label">{{ deductibleLabel }}</span>
|
<span id="deductible-label">{{ deductibleLabel }}</span>
|
||||||
|
|
@ -154,6 +154,7 @@ import { getHighestFullySatisfiedTier, getPackageContents } from '@/helpers/serv
|
||||||
|
|
||||||
// Constants
|
// Constants
|
||||||
import partTypeStrings from '@/constants/part-type-strings.js';
|
import partTypeStrings from '@/constants/part-type-strings.js';
|
||||||
|
import partNumberStrings from '@/constants/part-number-strings.js';
|
||||||
import widgetFields from '@/constants/cms-widget-fields.js';
|
import widgetFields from '@/constants/cms-widget-fields.js';
|
||||||
|
|
||||||
const VERIFYING_COVERAGE = 'Verifying coverage';
|
const VERIFYING_COVERAGE = 'Verifying coverage';
|
||||||
|
|
@ -177,8 +178,6 @@ export default {
|
||||||
const { supportingItems, glassParts, otherParts, vaps } = useMainStore().lineItems;
|
const { supportingItems, glassParts, otherParts, vaps } = useMainStore().lineItems;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
isNoComp: useMainStore().isNoComp,
|
|
||||||
isITAC: useMainStore().policy.isITAC,
|
|
||||||
isRepair,
|
isRepair,
|
||||||
glassToReplace: glassToReplace ?? [],
|
glassToReplace: glassToReplace ?? [],
|
||||||
vapsInOrder: vaps ?? [],
|
vapsInOrder: vaps ?? [],
|
||||||
|
|
@ -203,15 +202,18 @@ export default {
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
showDeductibleCartItem() {
|
||||||
|
return !useMainStore().isNoComp && !useMainStore().policy.isITAC;
|
||||||
|
},
|
||||||
baseServicePrice() {
|
baseServicePrice() {
|
||||||
return getPriceOfLineItems(this.baseServiceLineItems);
|
return getPriceOfLineItems(this.baseServiceLineItems);
|
||||||
},
|
},
|
||||||
isUnverified() {
|
isUnverified() {
|
||||||
return !this.isNoComp && !this.isITAC
|
return !useMainStore().isNoComp && !useMainStore().policy.isITAC
|
||||||
&& (this.deductible == null || !useMainStore().isVerifiedCoverageStatus);
|
&& (this.deductible == null || !useMainStore().isVerifiedCoverageStatus);
|
||||||
},
|
},
|
||||||
subTotal() {
|
subTotal() {
|
||||||
const basePrice = !this.isNoComp && !this.isITAC
|
const basePrice = !useMainStore().isNoComp && !useMainStore().policy.isITAC
|
||||||
? this.deductible
|
? this.deductible
|
||||||
: this.baseServicePrice;
|
: this.baseServicePrice;
|
||||||
return basePrice + this.packagePrice;
|
return basePrice + this.packagePrice;
|
||||||
|
|
@ -301,10 +303,9 @@ export default {
|
||||||
|
|
||||||
return currentPackage?.SubWidgetName ?? '';
|
return currentPackage?.SubWidgetName ?? '';
|
||||||
},
|
},
|
||||||
// TODO there is something weird with recycling in the backend where partType is Replace instead of recycle
|
|
||||||
recycleFeeCartItem() {
|
recycleFeeCartItem() {
|
||||||
const recycleFeeLineItem = useMainStore().lineItems.supportingItems
|
const recycleFeeLineItem = useMainStore().lineItems.supportingItems
|
||||||
?.find((lineItem) => lineItem.partNumber === partTypeStrings.RECYCLE_FEE);
|
?.find((lineItem) => lineItem.partNumber === partNumberStrings.RECYCLE_FEE);
|
||||||
return recycleFeeLineItem
|
return recycleFeeLineItem
|
||||||
? this.getCartItem(
|
? this.getCartItem(
|
||||||
this.getCmsContent(this.widget.recycleFee, widgetFields.TEXT_BLOCK_WIDGET.TEXT),
|
this.getCmsContent(this.widget.recycleFee, widgetFields.TEXT_BLOCK_WIDGET.TEXT),
|
||||||
|
|
@ -330,7 +331,9 @@ export default {
|
||||||
this.isExpanded = !this.isExpanded;
|
this.isExpanded = !this.isExpanded;
|
||||||
},
|
},
|
||||||
getDisplayed(amount) {
|
getDisplayed(amount) {
|
||||||
return this.isUnverified && !this.isNoComp && !this.isITAC
|
return this.isUnverified
|
||||||
|
&& !useMainStore().isNoComp
|
||||||
|
&& !useMainStore().policy.isITAC
|
||||||
? VERIFYING_COVERAGE
|
? VERIFYING_COVERAGE
|
||||||
: formatAmountInDollars(amount);
|
: formatAmountInDollars(amount);
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue