Tech review changes
This commit is contained in:
parent
90b847e72e
commit
7cbe82eb57
6 changed files with 14 additions and 15 deletions
|
|
@ -72,7 +72,7 @@ const endpoints = {
|
|||
url: "/parts/api/v1/parts/mobile-fee",
|
||||
method: "GET",
|
||||
},
|
||||
CashServicePackageDiscount: {
|
||||
GetServicePackageDiscountPart: {
|
||||
url: "/parts/api/v1/parts/service-package-discount",
|
||||
method: "POST",
|
||||
},
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ const storeActions = {
|
|||
GET_PART_FROM_CAPABILITY_QUESTION_ANSWER: "getPartFromCapabilityQuestionAnswer",
|
||||
GET_MOLDING_QUESTIONS: "getMoldingQuestions",
|
||||
GET_MOBILE_FEE_PART: "getMobileFeePart",
|
||||
CASH_SERVICE_PACKAGE_DISCOUNT: "cashServicePackageDiscount",
|
||||
GET_SERVICE_PACKAGE_DISCOUNT_PART: "getServicePackageDiscountPart",
|
||||
GET_SERVICEABILITY_DETAILS: "getServiceabilityDetails",
|
||||
GET_SHOP_TIME_SLOTS: "getShopTimeSlots",
|
||||
GET_MOBILE_TIME_SLOTS: "getMobileTimeSlots",
|
||||
|
|
|
|||
|
|
@ -229,7 +229,7 @@ export default {
|
|||
const servicePackageDiscountLineItems = this.servicePackageDiscountCartItem;
|
||||
let subTotal = 0;
|
||||
|
||||
subTotal += servicePackageDiscountLineItems?.subTotal;
|
||||
subTotal += servicePackageDiscountLineItems?.subTotal ?? 0;
|
||||
return subTotal;
|
||||
},
|
||||
getVapsCartItemsForSelectedPackage(packageName) {
|
||||
|
|
@ -272,7 +272,7 @@ export default {
|
|||
|
||||
getLineItemAmount(amount, useVerifyingText, category) {
|
||||
if (useVerifyingText) return this.verifyingCoverageText;
|
||||
return category == ("promos" && "servicePackageDiscount")
|
||||
return category == "promos" || category == "servicePackageDiscount"
|
||||
? "(" + this.currencyFormatter.format(amount * -1) + ")"
|
||||
: this.currencyFormatter.format(amount);
|
||||
},
|
||||
|
|
@ -825,11 +825,8 @@ export default {
|
|||
otherSupportingItemsCartItem() {
|
||||
let cartItem = null;
|
||||
|
||||
const servicePackageDiscountLineItem = this.supportingItems.find(
|
||||
(lineItem) => lineItem.partType == partTypeStrings.SERVICE_PACKAGE_DISCOUNT
|
||||
);
|
||||
const otherSupportingItems = this.supportingItems.filter((item) => {
|
||||
return item != servicePackageDiscountLineItem;
|
||||
return item.partType != partTypeStrings.SERVICE_PACKAGE_DISCOUNT;
|
||||
});
|
||||
// Don't include fees they are part of the package total
|
||||
let otherSupportingItemsLineItems =
|
||||
|
|
|
|||
|
|
@ -166,11 +166,12 @@ export default {
|
|||
if (isServicePackageDiscount) {
|
||||
const servicePackageDiscountPartResponse =
|
||||
await baseMixin.methods.dispatchStoreActionWithLogging(
|
||||
storeActions.CASH_SERVICE_PACKAGE_DISCOUNT,
|
||||
storeActions.GET_SERVICE_PACKAGE_DISCOUNT_PART,
|
||||
null,
|
||||
"quote"
|
||||
);
|
||||
servicePackageDiscountPart.push(servicePackageDiscountPartResponse.data);
|
||||
if (servicePackageDiscountPartResponse.data)
|
||||
servicePackageDiscountPart.push(servicePackageDiscountPartResponse.data);
|
||||
}
|
||||
const availableLineItems = [
|
||||
resultMap.rainDefense,
|
||||
|
|
@ -296,8 +297,8 @@ export default {
|
|||
vapsItemsSelectedAction(vapsItemsSelected) {
|
||||
this.lineItems.vaps = vapsItemsSelected;
|
||||
},
|
||||
servicePackageDiscountSelectedAction(servicePackageDiscountSelected) {
|
||||
this.lineItems.supportingItems = servicePackageDiscountSelected;
|
||||
servicePackageDiscountSelectedAction(supportingItemsSelected) {
|
||||
this.lineItems.supportingItems = supportingItemsSelected;
|
||||
},
|
||||
backButtonAction() {
|
||||
vehicleQuestionsMixin.methods.navigateBack(this);
|
||||
|
|
|
|||
|
|
@ -121,6 +121,7 @@ export default {
|
|||
buttonLabel: this.getHeaderTextFromCms(answer.SubWidgetName),
|
||||
buttonLabelSubCopy: this.getSubheaderTextFromCms(answer.SubWidgetName),
|
||||
buttonBodyCopy: this.getBodyTextFromCms(answer.SubWidgetName),
|
||||
//The package supports service-package-discount if it has the text value in CMS
|
||||
buttonAuxillaryCopy: this.getDiscountedPackagePriceString(
|
||||
answer.Name,
|
||||
this.isServicePackageDiscountOnOrder && answer.Text != ""
|
||||
|
|
|
|||
|
|
@ -1397,15 +1397,15 @@ export const actions = {
|
|||
pageNameToLog: pageNameToLog,
|
||||
});
|
||||
},
|
||||
cashServicePackageDiscount(context, { pageNameToLog }) {
|
||||
getServicePackageDiscountPart(context, { pageNameToLog }) {
|
||||
const damage = context.getters.damage;
|
||||
const damageType = damage.isRepair ? "Repair" : "Replace";
|
||||
const glassPieces = convertGlassPieceNamingForApi(damage.glassToReplace);
|
||||
|
||||
return globalMethods
|
||||
.callHttpClient({
|
||||
method: endpoints.CashServicePackageDiscount.method,
|
||||
endpoint: endpoints.CashServicePackageDiscount.url,
|
||||
method: endpoints.GetServicePackageDiscountPart.method,
|
||||
endpoint: endpoints.GetServicePackageDiscountPart.url,
|
||||
payload: {
|
||||
glassPieces: glassPieces,
|
||||
damageType: damageType,
|
||||
|
|
|
|||
Loading…
Reference in a new issue