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