Merge branch 'develop' into feature/CASH-152-ajc

This commit is contained in:
Adam Caouette 2025-03-06 16:11:14 -05:00
commit 7ed0b613d5
9 changed files with 82 additions and 18 deletions

View file

@ -105,6 +105,7 @@ const storeActions = {
SAVE_PAYPAL_TOKEN: "savePaypalToken",
SAVE_NEXTGEN_SETTLED_AMOUNT: "saveNextGenSettledAmount",
SAVE_IS_RECAL_ACK_OPT_IN: "saveIsRecalAckOptIn",
SAVE_IS_MSR_FEE_APPLICABLE: "saveIsMSRFeeApplicable",
CREATE_SUBMITTED_ORDER: "createSubmittedOrder",
RESET_SUBMITTED_ORDER: "resetSubmittedOrder",

View file

@ -64,6 +64,7 @@ const storeMutations = {
LOCK_TOKEN: "updateLockToken",
UPDATE_SETTLED_TENDER_AMOUNT: "updateSettledTenderAmount",
UPDATE_IS_RECAL_ACK_OPT_IN: "updateIsRecalAckOptIn",
UPDATE_IS_MSR_FEE_APPLICABLE: "updateIsMSRFeeApplicable",
// EVENT BUS MUTATIONS
ADD_EVENT_TO_BUS: "addEventToBus",

View file

@ -189,6 +189,12 @@ export default {
position: absolute;
left: -9999px;
+ .package-label.pricing-by-day-pkg-lbl {
@include media-breakpoint-up(md) {
padding-bottom: 0.75rem;
}
}
+ .package-label.pricing-by-day-pkg-lbl.adjust-top {
/* Copying a component for an experiment will cause duplication of css classes.
This can cause problems if you want change the value of something only for the experiment
@ -235,6 +241,9 @@ export default {
&:after {
top: 1.25rem;
}
@include media-breakpoint-up(md) {
padding-bottom: 0.75rem;
}
}
+ .package-label {
@ -254,6 +263,7 @@ export default {
max-height: 126px;
@include media-breakpoint-up(md) {
max-height: 500px;
padding-bottom: 3rem;
}
transition: max-height 0.25s ease-in;

View file

@ -5,6 +5,8 @@ import cart from "@/fmg-components/cart/cart.vue";
import { shallowMount } from "@vue/test-utils";
import { getMountOptions } from "@/helpers/unit-test-helper.js";
import store from "@/store";
global.$logger = {
logInformation: jest.fn(),
logWarning: jest.fn(),
@ -266,6 +268,7 @@ describe("cart.vue", () => {
// Mobile Fee Cart Item
test("if there is mobile fee on the order, a mobile fee cart item should be added to the cart", () => {
// Arrange
store.getters.order.isMSRFeeApplicable = false;
const lineItems = {
glassParts: [],
supportingItems: [
@ -403,6 +406,7 @@ function setupMocks({ options, props }) {
if (props) mountOptions.propsData = props;
mountOptions.global.mixins = [mockBaseMixin];
mountOptions.global.mocks["$store"] = store;
const wrapper = shallowMount(cart, mountOptions);

View file

@ -756,7 +756,7 @@ export default {
return this.getCmsContent("RecycleFeeTextWidget", "Text");
},
showRecycleFeeCartItem() {
if (!this.isInsurance || this.isItac || this.isNoComp) {
if (this.isCashItacNoComp) {
// CASH, ITAC, NOCOMP ORDERS
return !this.isRepair;
} else {
@ -849,11 +849,18 @@ export default {
return cartItem;
},
isCashItacNoComp() {
return !this.isInsurance || this.isITAC || this.isNoComp;
},
getIsMSRFeeApplicableFromStore() {
return this.$store.getters.order.isMSRFeeApplicable;
},
mobileFeeCartItemName() {
return this.getCmsContent("MobileServiceTextWidget", "Text");
},
mobileFeeCartItem() {
let cartItem = null;
let showMobileFeeCartItem = false;
const mobileFeeLineItem = this.supportingItems.find(
(lineItem) => lineItem.partType == partTypeStrings.MOBILE_FEE
);
@ -863,7 +870,15 @@ export default {
(mobileFeeLineItem?.laborAmount ?? 0) +
(mobileFeeLineItem?.sellingPrice ?? 0);
if (mobileFeeLineItem && mobileTotal > 0) {
if (mobileTotal > 0) {
if (this.getIsMSRFeeApplicableFromStore) {
showMobileFeeCartItem = this.isCashItacNoComp;
} else {
showMobileFeeCartItem = true;
}
}
if (mobileFeeLineItem && showMobileFeeCartItem) {
cartItem = {
name: this.mobileFeeCartItemName,
category: cartItemCategories.SUPPORTING_ITEMS,

View file

@ -577,11 +577,9 @@ export default {
} else {
if (this.paymentMethod == paymentMethods.INSURANCE) {
this.dispatchStoreAction(this.storeActions.SAVE_PAYMENT_TYPE, true, false);
this.$router.navigateWithoutSaving(
return this.$router.navigateWithSaving(
this.navigationScenarios.CLICKED_INSURANCE,
this.$route,
{},
{ [routerParams.DISPLAY_PIA_ALERT]: false }
this.$route
);
} else {
this.setupPia();

View file

@ -307,7 +307,7 @@ export default {
return (
this.displayMSR &&
this.mobileFeePart?.partNumber == partNumberStrings.MOBILE_STATIC_RECAL_FEE &&
(this.isInsurance && !this.isITAC ? this.mobileFeePart?.isInsurable : true)
(this.isCashItacNoComp || this.mobileFeePart?.isInsurable)
);
},
displayMSR() {
@ -317,19 +317,25 @@ export default {
?.toLowerCase() === "true"
);
},
mobileFeeApplies() {
if (
isCashItacNoComp() {
return !this.isInsurance || this.isITAC || this.isNoComp;
},
mobileFeeHasPrice() {
return (
this.mobileFeePart?.laborAmount > 0 ||
this.mobileFeePart?.sellingPrice > 0 ||
this.mobileFeePart?.kitPrice > 0
) {
return true;
);
},
mobileFeeApplies() {
if (this.isMobileStaticRecalibrationApplicable && this.mobileFeeHasPrice) {
return this.isCashItacNoComp;
} else {
return false;
return this.mobileFeeHasPrice;
}
},
showMobileFreeAlert() {
if (this.isServiceableMobile && !this.isInsurance && !this.mobileFeeApplies) {
if (this.isServiceableMobile && !this.isInsurance && !this.mobileFeeHasPrice) {
return true;
}
return false;
@ -387,6 +393,9 @@ export default {
isITAC() {
return store.getters.order.policy.isItac;
},
isNoComp() {
return store.getters.order.policy.isNoComp;
},
},
methods: {
arePagePrerequisitesValid() {
@ -572,8 +581,22 @@ export default {
);
}
},
updateAndSaveIsMSRFeeApplicable() {
const isMSRFeeApplicable =
this.isMobileStaticRecalibrationApplicable &&
this.selectedAppointmentType == "Mobile";
this.dispatchStoreAction(
this.storeActions.SAVE_IS_MSR_FEE_APPLICABLE,
isMSRFeeApplicable
);
},
updateAndSaveSupportingItems() {
const supportingItems = store.getters.lineItems.supportingItems;
let supportingItems = store.getters.lineItems.supportingItems;
supportingItems =
!supportingItems && this.isMobileStaticRecalibrationApplicable
? []
: supportingItems;
// for insurance orders, fees can get removed causing supportingitems to be null or empty
if (!supportingItems) {
@ -676,6 +699,7 @@ export default {
}
this.updateAndSaveSupportingItems();
this.updateAndSaveIsMSRFeeApplicable();
this.$router.navigateWithSaving(this.navigationScenarios.CLICKED_FORWARD, this.$route);
},
openModalAction(modalName) {

View file

@ -43,12 +43,14 @@ export default {
const submittedOrder = baseMixin.methods.getSubmittedOrder();
const hasSubmittedOrder = baseMixin.methods.hasSubmittedOrder();
const hasSubmittedOrderAtConfirmationPage =
hasSubmittedOrder && currentPageName?.toLowerCase() == fmgPageValues.CONFIRMATION;
const refSequenceNum =
store.getters.order.referralSequenceNumber ||
submittedOrder?.referralSequenceNumber;
const refSequenceNum = hasSubmittedOrderAtConfirmationPage
? submittedOrder.referralSequenceNumber
: store.getters.order.referralSequenceNumber;
const parentAccountNum = hasSubmittedOrder
const parentAccountNum = hasSubmittedOrderAtConfirmationPage
? submittedOrder.payment.parentAccountNumber
: store.getters.order.payment.parentAccountNumber;

View file

@ -176,6 +176,7 @@ const getDefaultState = () => {
lockToken: null,
settledTenderAmount: 0,
isRecalAckOptIn: false,
isMSRFeeApplicable: false,
},
applicationUser: {
eventBus: [],
@ -315,6 +316,9 @@ export const mutations = {
updateIsRecalAckOptIn(state, isRecalAckOptIn) {
state.order.isRecalAckOptIn = isRecalAckOptIn;
},
updateIsMSRFeeApplicable(state, isMSRFeeApplicable) {
state.order.isMSRFeeApplicable = isMSRFeeApplicable;
},
updateCCToken(state, ccToken) {
state.order.payment.ccToken.subscriptionId = ccToken.subscriptionId;
state.order.payment.ccToken.expMonth = ccToken.expMonth;
@ -2233,6 +2237,7 @@ export const actions = {
createUnscheduledStatusWorkOrderForPIA: createUnscheduledStatusWorkOrderForPIA,
lockToken: order.lockToken,
isRecalAckOptIn: order.isRecalAckOptIn,
isMSRFeeApplicable: order.isMSRFeeApplicable,
},
},
logApiCall: true,
@ -2631,6 +2636,10 @@ export const actions = {
context.commit(storeMutations.UPDATE_IS_RECAL_ACK_OPT_IN, isRecalAckOptIn);
},
saveIsMSRFeeApplicable(context, isMSRFeeApplicable) {
context.commit(storeMutations.UPDATE_IS_MSR_FEE_APPLICABLE, isMSRFeeApplicable);
},
saveParentAccountNumber(context, parentAccountNumber) {
context.commit(storeMutations.UPDATE_PARENT_ACCT_NUMBER, parentAccountNumber);
},