Update payment-method & cart for new recal

This commit is contained in:
Chloe Herd 2024-09-17 14:23:55 -04:00
parent 664e2a734a
commit 51655e7247
4 changed files with 13 additions and 12 deletions

View file

@ -305,8 +305,8 @@ export default {
if (!this.lineItems || this.lineItems.length < 1) return;
const lineItemsCopy = deepClone(this.lineItems);
lineItemsCopy.supportingItems = lineItemsCopy.supportingItems
? baseMixin.methods.filterOutRecalibration(lineItemsCopy?.supportingItems)
lineItemsCopy.glassParts = lineItemsCopy.glassParts
? baseMixin.methods.filterOutRecalibration(lineItemsCopy?.glassParts)
: [];
return lineItemsCopy;
},

View file

@ -153,6 +153,7 @@ import { partTypeStrings } from "@/constants/part-type-strings";
import { mapTaxedLineItemsToStoreFormat } from "../../store";
import { coverageStatus } from "@/constants/insurance";
import { containsLineItemWithPartType } from "@/helpers/service-package-helper";
import { containsRecalParts } from "@/helpers/recal-helper";
defineRule("payment-method-required", required(errorMessages.OPTION_REQUIRED));
defineRule("recal-ack-required", required(errorMessages.RECAL_ACK_REQUIRED));
@ -588,10 +589,11 @@ export default {
},
computed: {
isRecalibrationOnOrder() {
return containsLineItemWithPartType(
partTypeStrings.RECALIBRATION,
this.$store.getters.order.lineItems?.supportingItems
);
const order = baseMixin.methods.hasSubmittedOrder()
? baseMixin.methods.getSubmittedOrder()
: this.$store.getters.order;
return containsRecalParts(order.lineItems);
},
shouldHideRecalibration() {
return this.getSettingValue(experimentSettings.RECAL_PRICE_REMOVE);

View file

@ -8,6 +8,7 @@ import { queryStrings } from "@/constants/query-strings";
import { dynamicStrings } from "@/constants/dynamic-strings";
import { partTypeStrings } from "../constants/part-type-strings";
import { showFmgLoadingModal } from "@/helpers/loading-modal-helper";
import { getItemsWithoutRecalParts } from "@/helpers/recal-helper";
export default {
data() {
@ -103,10 +104,7 @@ export default {
return filteredLineItems;
},
filterOutRecalibration(lineItems) {
const filteredLineItems = lineItems.filter((item) => {
return !item.partType.includes(partTypeStrings.RECALIBRATION);
});
return filteredLineItems;
return getItemsWithoutRecalParts(lineItems);
},
getTotalPriceOfAllLineItemsAndChildParts(lineItems, includeTax) {
let totalPrice = 0;

View file

@ -2422,8 +2422,9 @@ export const actions = {
}));
const order = context.getters.order;
var providerNumber = order.serviceLocation?.provider?.providerNumber ?? order.serviceLocation?.zipCodeCtu;
var providerNumber =
order.serviceLocation?.provider?.providerNumber ?? order.serviceLocation?.zipCodeCtu;
if (providerNumber.startsWith("00") && providerNumber.length > 5) {
providerNumber = providerNumber.substring(1);
}