Merge branch 'develop' into feature/CASH-152-refactor-1
This commit is contained in:
commit
fda6bc78d2
9 changed files with 82 additions and 18 deletions
|
|
@ -105,6 +105,7 @@ const storeActions = {
|
||||||
SAVE_PAYPAL_TOKEN: "savePaypalToken",
|
SAVE_PAYPAL_TOKEN: "savePaypalToken",
|
||||||
SAVE_NEXTGEN_SETTLED_AMOUNT: "saveNextGenSettledAmount",
|
SAVE_NEXTGEN_SETTLED_AMOUNT: "saveNextGenSettledAmount",
|
||||||
SAVE_IS_RECAL_ACK_OPT_IN: "saveIsRecalAckOptIn",
|
SAVE_IS_RECAL_ACK_OPT_IN: "saveIsRecalAckOptIn",
|
||||||
|
SAVE_IS_MSR_FEE_APPLICABLE: "saveIsMSRFeeApplicable",
|
||||||
|
|
||||||
CREATE_SUBMITTED_ORDER: "createSubmittedOrder",
|
CREATE_SUBMITTED_ORDER: "createSubmittedOrder",
|
||||||
RESET_SUBMITTED_ORDER: "resetSubmittedOrder",
|
RESET_SUBMITTED_ORDER: "resetSubmittedOrder",
|
||||||
|
|
|
||||||
|
|
@ -64,6 +64,7 @@ const storeMutations = {
|
||||||
LOCK_TOKEN: "updateLockToken",
|
LOCK_TOKEN: "updateLockToken",
|
||||||
UPDATE_SETTLED_TENDER_AMOUNT: "updateSettledTenderAmount",
|
UPDATE_SETTLED_TENDER_AMOUNT: "updateSettledTenderAmount",
|
||||||
UPDATE_IS_RECAL_ACK_OPT_IN: "updateIsRecalAckOptIn",
|
UPDATE_IS_RECAL_ACK_OPT_IN: "updateIsRecalAckOptIn",
|
||||||
|
UPDATE_IS_MSR_FEE_APPLICABLE: "updateIsMSRFeeApplicable",
|
||||||
|
|
||||||
// EVENT BUS MUTATIONS
|
// EVENT BUS MUTATIONS
|
||||||
ADD_EVENT_TO_BUS: "addEventToBus",
|
ADD_EVENT_TO_BUS: "addEventToBus",
|
||||||
|
|
|
||||||
|
|
@ -189,6 +189,12 @@ export default {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: -9999px;
|
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 {
|
+ .package-label.pricing-by-day-pkg-lbl.adjust-top {
|
||||||
/* Copying a component for an experiment will cause duplication of css classes.
|
/* 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
|
This can cause problems if you want change the value of something only for the experiment
|
||||||
|
|
@ -235,6 +241,9 @@ export default {
|
||||||
&:after {
|
&:after {
|
||||||
top: 1.25rem;
|
top: 1.25rem;
|
||||||
}
|
}
|
||||||
|
@include media-breakpoint-up(md) {
|
||||||
|
padding-bottom: 0.75rem;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
+ .package-label {
|
+ .package-label {
|
||||||
|
|
@ -254,6 +263,7 @@ export default {
|
||||||
max-height: 126px;
|
max-height: 126px;
|
||||||
@include media-breakpoint-up(md) {
|
@include media-breakpoint-up(md) {
|
||||||
max-height: 500px;
|
max-height: 500px;
|
||||||
|
padding-bottom: 3rem;
|
||||||
}
|
}
|
||||||
transition: max-height 0.25s ease-in;
|
transition: max-height 0.25s ease-in;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,8 @@ import cart from "@/fmg-components/cart/cart.vue";
|
||||||
import { shallowMount } from "@vue/test-utils";
|
import { shallowMount } from "@vue/test-utils";
|
||||||
import { getMountOptions } from "@/helpers/unit-test-helper.js";
|
import { getMountOptions } from "@/helpers/unit-test-helper.js";
|
||||||
|
|
||||||
|
import store from "@/store";
|
||||||
|
|
||||||
global.$logger = {
|
global.$logger = {
|
||||||
logInformation: jest.fn(),
|
logInformation: jest.fn(),
|
||||||
logWarning: jest.fn(),
|
logWarning: jest.fn(),
|
||||||
|
|
@ -266,6 +268,7 @@ describe("cart.vue", () => {
|
||||||
// Mobile Fee Cart Item
|
// Mobile Fee Cart Item
|
||||||
test("if there is mobile fee on the order, a mobile fee cart item should be added to the cart", () => {
|
test("if there is mobile fee on the order, a mobile fee cart item should be added to the cart", () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
|
store.getters.order.isMSRFeeApplicable = false;
|
||||||
const lineItems = {
|
const lineItems = {
|
||||||
glassParts: [],
|
glassParts: [],
|
||||||
supportingItems: [
|
supportingItems: [
|
||||||
|
|
@ -403,6 +406,7 @@ function setupMocks({ options, props }) {
|
||||||
if (props) mountOptions.propsData = props;
|
if (props) mountOptions.propsData = props;
|
||||||
|
|
||||||
mountOptions.global.mixins = [mockBaseMixin];
|
mountOptions.global.mixins = [mockBaseMixin];
|
||||||
|
mountOptions.global.mocks["$store"] = store;
|
||||||
|
|
||||||
const wrapper = shallowMount(cart, mountOptions);
|
const wrapper = shallowMount(cart, mountOptions);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -756,7 +756,7 @@ export default {
|
||||||
return this.getCmsContent("RecycleFeeTextWidget", "Text");
|
return this.getCmsContent("RecycleFeeTextWidget", "Text");
|
||||||
},
|
},
|
||||||
showRecycleFeeCartItem() {
|
showRecycleFeeCartItem() {
|
||||||
if (!this.isInsurance || this.isItac || this.isNoComp) {
|
if (this.isCashItacNoComp) {
|
||||||
// CASH, ITAC, NOCOMP ORDERS
|
// CASH, ITAC, NOCOMP ORDERS
|
||||||
return !this.isRepair;
|
return !this.isRepair;
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -849,11 +849,18 @@ export default {
|
||||||
|
|
||||||
return cartItem;
|
return cartItem;
|
||||||
},
|
},
|
||||||
|
isCashItacNoComp() {
|
||||||
|
return !this.isInsurance || this.isITAC || this.isNoComp;
|
||||||
|
},
|
||||||
|
getIsMSRFeeApplicableFromStore() {
|
||||||
|
return this.$store.getters.order.isMSRFeeApplicable;
|
||||||
|
},
|
||||||
mobileFeeCartItemName() {
|
mobileFeeCartItemName() {
|
||||||
return this.getCmsContent("MobileServiceTextWidget", "Text");
|
return this.getCmsContent("MobileServiceTextWidget", "Text");
|
||||||
},
|
},
|
||||||
mobileFeeCartItem() {
|
mobileFeeCartItem() {
|
||||||
let cartItem = null;
|
let cartItem = null;
|
||||||
|
let showMobileFeeCartItem = false;
|
||||||
const mobileFeeLineItem = this.supportingItems.find(
|
const mobileFeeLineItem = this.supportingItems.find(
|
||||||
(lineItem) => lineItem.partType == partTypeStrings.MOBILE_FEE
|
(lineItem) => lineItem.partType == partTypeStrings.MOBILE_FEE
|
||||||
);
|
);
|
||||||
|
|
@ -863,7 +870,15 @@ export default {
|
||||||
(mobileFeeLineItem?.laborAmount ?? 0) +
|
(mobileFeeLineItem?.laborAmount ?? 0) +
|
||||||
(mobileFeeLineItem?.sellingPrice ?? 0);
|
(mobileFeeLineItem?.sellingPrice ?? 0);
|
||||||
|
|
||||||
if (mobileFeeLineItem && mobileTotal > 0) {
|
if (mobileTotal > 0) {
|
||||||
|
if (this.getIsMSRFeeApplicableFromStore) {
|
||||||
|
showMobileFeeCartItem = this.isCashItacNoComp;
|
||||||
|
} else {
|
||||||
|
showMobileFeeCartItem = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mobileFeeLineItem && showMobileFeeCartItem) {
|
||||||
cartItem = {
|
cartItem = {
|
||||||
name: this.mobileFeeCartItemName,
|
name: this.mobileFeeCartItemName,
|
||||||
category: cartItemCategories.SUPPORTING_ITEMS,
|
category: cartItemCategories.SUPPORTING_ITEMS,
|
||||||
|
|
|
||||||
|
|
@ -577,11 +577,9 @@ export default {
|
||||||
} else {
|
} else {
|
||||||
if (this.paymentMethod == paymentMethods.INSURANCE) {
|
if (this.paymentMethod == paymentMethods.INSURANCE) {
|
||||||
this.dispatchStoreAction(this.storeActions.SAVE_PAYMENT_TYPE, true, false);
|
this.dispatchStoreAction(this.storeActions.SAVE_PAYMENT_TYPE, true, false);
|
||||||
this.$router.navigateWithoutSaving(
|
return this.$router.navigateWithSaving(
|
||||||
this.navigationScenarios.CLICKED_INSURANCE,
|
this.navigationScenarios.CLICKED_INSURANCE,
|
||||||
this.$route,
|
this.$route
|
||||||
{},
|
|
||||||
{ [routerParams.DISPLAY_PIA_ALERT]: false }
|
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
this.setupPia();
|
this.setupPia();
|
||||||
|
|
|
||||||
|
|
@ -307,7 +307,7 @@ export default {
|
||||||
return (
|
return (
|
||||||
this.displayMSR &&
|
this.displayMSR &&
|
||||||
this.mobileFeePart?.partNumber == partNumberStrings.MOBILE_STATIC_RECAL_FEE &&
|
this.mobileFeePart?.partNumber == partNumberStrings.MOBILE_STATIC_RECAL_FEE &&
|
||||||
(this.isInsurance && !this.isITAC ? this.mobileFeePart?.isInsurable : true)
|
(this.isCashItacNoComp || this.mobileFeePart?.isInsurable)
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
displayMSR() {
|
displayMSR() {
|
||||||
|
|
@ -317,19 +317,25 @@ export default {
|
||||||
?.toLowerCase() === "true"
|
?.toLowerCase() === "true"
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
mobileFeeApplies() {
|
isCashItacNoComp() {
|
||||||
if (
|
return !this.isInsurance || this.isITAC || this.isNoComp;
|
||||||
|
},
|
||||||
|
mobileFeeHasPrice() {
|
||||||
|
return (
|
||||||
this.mobileFeePart?.laborAmount > 0 ||
|
this.mobileFeePart?.laborAmount > 0 ||
|
||||||
this.mobileFeePart?.sellingPrice > 0 ||
|
this.mobileFeePart?.sellingPrice > 0 ||
|
||||||
this.mobileFeePart?.kitPrice > 0
|
this.mobileFeePart?.kitPrice > 0
|
||||||
) {
|
);
|
||||||
return true;
|
},
|
||||||
|
mobileFeeApplies() {
|
||||||
|
if (this.isMobileStaticRecalibrationApplicable && this.mobileFeeHasPrice) {
|
||||||
|
return this.isCashItacNoComp;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return this.mobileFeeHasPrice;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
showMobileFreeAlert() {
|
showMobileFreeAlert() {
|
||||||
if (this.isServiceableMobile && !this.isInsurance && !this.mobileFeeApplies) {
|
if (this.isServiceableMobile && !this.isInsurance && !this.mobileFeeHasPrice) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -387,6 +393,9 @@ export default {
|
||||||
isITAC() {
|
isITAC() {
|
||||||
return store.getters.order.policy.isItac;
|
return store.getters.order.policy.isItac;
|
||||||
},
|
},
|
||||||
|
isNoComp() {
|
||||||
|
return store.getters.order.policy.isNoComp;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
arePagePrerequisitesValid() {
|
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() {
|
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
|
// for insurance orders, fees can get removed causing supportingitems to be null or empty
|
||||||
if (!supportingItems) {
|
if (!supportingItems) {
|
||||||
|
|
@ -676,6 +699,7 @@ export default {
|
||||||
}
|
}
|
||||||
|
|
||||||
this.updateAndSaveSupportingItems();
|
this.updateAndSaveSupportingItems();
|
||||||
|
this.updateAndSaveIsMSRFeeApplicable();
|
||||||
this.$router.navigateWithSaving(this.navigationScenarios.CLICKED_FORWARD, this.$route);
|
this.$router.navigateWithSaving(this.navigationScenarios.CLICKED_FORWARD, this.$route);
|
||||||
},
|
},
|
||||||
openModalAction(modalName) {
|
openModalAction(modalName) {
|
||||||
|
|
|
||||||
|
|
@ -43,12 +43,14 @@ export default {
|
||||||
|
|
||||||
const submittedOrder = baseMixin.methods.getSubmittedOrder();
|
const submittedOrder = baseMixin.methods.getSubmittedOrder();
|
||||||
const hasSubmittedOrder = baseMixin.methods.hasSubmittedOrder();
|
const hasSubmittedOrder = baseMixin.methods.hasSubmittedOrder();
|
||||||
|
const hasSubmittedOrderAtConfirmationPage =
|
||||||
|
hasSubmittedOrder && currentPageName?.toLowerCase() == fmgPageValues.CONFIRMATION;
|
||||||
|
|
||||||
const refSequenceNum =
|
const refSequenceNum = hasSubmittedOrderAtConfirmationPage
|
||||||
store.getters.order.referralSequenceNumber ||
|
? submittedOrder.referralSequenceNumber
|
||||||
submittedOrder?.referralSequenceNumber;
|
: store.getters.order.referralSequenceNumber;
|
||||||
|
|
||||||
const parentAccountNum = hasSubmittedOrder
|
const parentAccountNum = hasSubmittedOrderAtConfirmationPage
|
||||||
? submittedOrder.payment.parentAccountNumber
|
? submittedOrder.payment.parentAccountNumber
|
||||||
: store.getters.order.payment.parentAccountNumber;
|
: store.getters.order.payment.parentAccountNumber;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -176,6 +176,7 @@ const getDefaultState = () => {
|
||||||
lockToken: null,
|
lockToken: null,
|
||||||
settledTenderAmount: 0,
|
settledTenderAmount: 0,
|
||||||
isRecalAckOptIn: false,
|
isRecalAckOptIn: false,
|
||||||
|
isMSRFeeApplicable: false,
|
||||||
},
|
},
|
||||||
applicationUser: {
|
applicationUser: {
|
||||||
eventBus: [],
|
eventBus: [],
|
||||||
|
|
@ -315,6 +316,9 @@ export const mutations = {
|
||||||
updateIsRecalAckOptIn(state, isRecalAckOptIn) {
|
updateIsRecalAckOptIn(state, isRecalAckOptIn) {
|
||||||
state.order.isRecalAckOptIn = isRecalAckOptIn;
|
state.order.isRecalAckOptIn = isRecalAckOptIn;
|
||||||
},
|
},
|
||||||
|
updateIsMSRFeeApplicable(state, isMSRFeeApplicable) {
|
||||||
|
state.order.isMSRFeeApplicable = isMSRFeeApplicable;
|
||||||
|
},
|
||||||
updateCCToken(state, ccToken) {
|
updateCCToken(state, ccToken) {
|
||||||
state.order.payment.ccToken.subscriptionId = ccToken.subscriptionId;
|
state.order.payment.ccToken.subscriptionId = ccToken.subscriptionId;
|
||||||
state.order.payment.ccToken.expMonth = ccToken.expMonth;
|
state.order.payment.ccToken.expMonth = ccToken.expMonth;
|
||||||
|
|
@ -2233,6 +2237,7 @@ export const actions = {
|
||||||
createUnscheduledStatusWorkOrderForPIA: createUnscheduledStatusWorkOrderForPIA,
|
createUnscheduledStatusWorkOrderForPIA: createUnscheduledStatusWorkOrderForPIA,
|
||||||
lockToken: order.lockToken,
|
lockToken: order.lockToken,
|
||||||
isRecalAckOptIn: order.isRecalAckOptIn,
|
isRecalAckOptIn: order.isRecalAckOptIn,
|
||||||
|
isMSRFeeApplicable: order.isMSRFeeApplicable,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
logApiCall: true,
|
logApiCall: true,
|
||||||
|
|
@ -2631,6 +2636,10 @@ export const actions = {
|
||||||
context.commit(storeMutations.UPDATE_IS_RECAL_ACK_OPT_IN, isRecalAckOptIn);
|
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) {
|
saveParentAccountNumber(context, parentAccountNumber) {
|
||||||
context.commit(storeMutations.UPDATE_PARENT_ACCT_NUMBER, parentAccountNumber);
|
context.commit(storeMutations.UPDATE_PARENT_ACCT_NUMBER, parentAccountNumber);
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue