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