Update quote to use new parts
This commit is contained in:
parent
51fb83932d
commit
e29248a7ed
2 changed files with 14 additions and 18 deletions
|
|
@ -30,6 +30,7 @@
|
|||
insuranceCmsWidgetName="InsuranceServicePackageQuestionWidget"
|
||||
groupName="ServicePackageQuestion"
|
||||
:availableLineItems="availableLineItems"
|
||||
:shouldHideRecalibration="shouldHideRecalibration"
|
||||
:isInsuranceSelected="isInsuranceSelected"
|
||||
@vapsItemsSelected="vapsItemsSelectedAction"
|
||||
@servicePackageDiscountSelected="servicePackageDiscountSelectedAction"
|
||||
|
|
@ -131,6 +132,7 @@ import { containsLineItemWithPartType } from "@/helpers/service-package-helper";
|
|||
import { nextTick } from "vue";
|
||||
import { packageNames } from "@/constants/package-names";
|
||||
import { navigateToHeritageFunnel } from "@/helpers/heritage-integration/navigation-helper";
|
||||
import { containsRecalParts } from "@/helpers/recal-helper";
|
||||
defineRule("option-required", required(errorMessages.OPTION_REQUIRED));
|
||||
|
||||
export default {
|
||||
|
|
@ -209,10 +211,7 @@ export default {
|
|||
];
|
||||
|
||||
// If the recal experiment is found then log the experiment exposure.
|
||||
const isRecalibrationOnOrder = containsLineItemWithPartType(
|
||||
partTypeStrings.RECALIBRATION,
|
||||
availableLineItems
|
||||
);
|
||||
const isRecalibrationOnOrder = containsRecalParts(availableLineItems);
|
||||
const canSafeliteRecalibrate = nullSafeGlassParts.some((glassPart) => {
|
||||
return glassPart.partType === "WINDSHIELD" && glassPart.canSafeliteRecalibrate;
|
||||
});
|
||||
|
|
@ -354,10 +353,7 @@ export default {
|
|||
return Object.assign({}, this.lineItems);
|
||||
},
|
||||
isRecalibrationOnOrder() {
|
||||
return containsLineItemWithPartType(
|
||||
partTypeStrings.RECALIBRATION,
|
||||
this?.availableLineItems
|
||||
);
|
||||
return containsRecalParts(this.lineItems);
|
||||
},
|
||||
shouldHideRecalibration() {
|
||||
const recalSettingValue = experimentMixin.methods.getSettingValue(
|
||||
|
|
@ -366,10 +362,13 @@ export default {
|
|||
return recalSettingValue;
|
||||
},
|
||||
showAfterpayBanner() {
|
||||
return !this.isInsuranceSelected && (!this.isRecalibrationOnOrder || !this.shouldHideRecalibration)
|
||||
return (
|
||||
!this.isInsuranceSelected &&
|
||||
(!this.isRecalibrationOnOrder || !this.shouldHideRecalibration)
|
||||
);
|
||||
},
|
||||
showRecalDisclaimer() {
|
||||
return this.isRecalibrationOnOrder && this.shouldHideRecalibration
|
||||
return this.isRecalibrationOnOrder && this.shouldHideRecalibration;
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@ import {
|
|||
getPromosWithAddableVaps,
|
||||
getLineItemsThatMatchPromos,
|
||||
} from "@/helpers/promotions-helper";
|
||||
import { containsRecalParts, getItemsWithoutRecalParts } from "@/helpers/recal-helper";
|
||||
|
||||
export default {
|
||||
name: "servicePackageQuestion",
|
||||
|
|
@ -49,6 +50,7 @@ export default {
|
|||
availableLineItems: null,
|
||||
activePromos: null,
|
||||
servicePackage: null,
|
||||
shouldHideRecalibration: Boolean,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
|
@ -142,10 +144,7 @@ export default {
|
|||
return modifiedAnswers;
|
||||
},
|
||||
isRecalibrationOnOrder() {
|
||||
return containsLineItemWithPartType(
|
||||
partTypeStrings.RECALIBRATION,
|
||||
this.nullSafeAvailableLineItems
|
||||
);
|
||||
return containsRecalParts(this.nullSafeAvailableLineItems);
|
||||
},
|
||||
isServicePackageDiscountOnOrder() {
|
||||
return containsLineItemWithPartType(
|
||||
|
|
@ -242,10 +241,8 @@ export default {
|
|||
},
|
||||
getPackagePrice(packageName, { discountedPrice = false, servicePackageDiscount = false }) {
|
||||
var lineItemsToPrice = [...this.nullSafeAvailableLineItems];
|
||||
if (this.isRecalibrationOnOrder) {
|
||||
lineItemsToPrice = lineItemsToPrice.filter((item) => {
|
||||
return item.partType != partTypeStrings.RECALIBRATION;
|
||||
});
|
||||
if (this.shouldHideRecalibration && this.isRecalibrationOnOrder) {
|
||||
lineItemsToPrice = getItemsWithoutRecalParts(lineItemsToPrice);
|
||||
}
|
||||
|
||||
//remove service package discount part
|
||||
|
|
|
|||
Loading…
Reference in a new issue