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