Merge branch 'develop' into nation/CASH-2415
This commit is contained in:
commit
fe576a5e69
27 changed files with 412 additions and 168 deletions
|
|
@ -180,10 +180,6 @@ const endpoints = {
|
||||||
url: "/analytics/api/v1/analytics/log-part-questions",
|
url: "/analytics/api/v1/analytics/log-part-questions",
|
||||||
method: "POST",
|
method: "POST",
|
||||||
},
|
},
|
||||||
LogDigitalConsumer: {
|
|
||||||
url: "/analytics/api/v1/analytics/digitalconsumer-log",
|
|
||||||
method: "POST",
|
|
||||||
},
|
|
||||||
LogFmgSessionData: {
|
LogFmgSessionData: {
|
||||||
url: "/analytics/api/v1/analytics/digitalconsumer-session-logging",
|
url: "/analytics/api/v1/analytics/digitalconsumer-session-logging",
|
||||||
method: "POST",
|
method: "POST",
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@ const experimentSettings = {
|
||||||
INSURANCE_TAB_TO_DISPLAY_THRESHOLD_INTERNAL: "NextGen_InternalInsuranceTabDisplayThreshold",
|
INSURANCE_TAB_TO_DISPLAY_THRESHOLD_INTERNAL: "NextGen_InternalInsuranceTabDisplayThreshold",
|
||||||
INSURANCE_TAB_TO_DISPLAY_THRESHOLD_EXTERNAL: "NextGen_ExternalInsuranceTabDisplayThreshold",
|
INSURANCE_TAB_TO_DISPLAY_THRESHOLD_EXTERNAL: "NextGen_ExternalInsuranceTabDisplayThreshold",
|
||||||
DISPLAY_MSR: "DisplayMSR",
|
DISPLAY_MSR: "DisplayMSR",
|
||||||
|
ENABLE_MSR_SPLIT_PAY: "EnableMSRSplitPay",
|
||||||
DISPLAY_WAITLIST: "DisplayWaitlist2.0",
|
DISPLAY_WAITLIST: "DisplayWaitlist2.0",
|
||||||
WAITLIST_THRESHOLD_DAYS: "Waitlist_Threshold_Days",
|
WAITLIST_THRESHOLD_DAYS: "Waitlist_Threshold_Days",
|
||||||
PRICING_BY_DAY: "DisplayPricingByDay",
|
PRICING_BY_DAY: "DisplayPricingByDay",
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,6 @@ const storeActions = {
|
||||||
LOG_CUSTOM_EVENT: "logCustomEvent",
|
LOG_CUSTOM_EVENT: "logCustomEvent",
|
||||||
INITIALIZE_SESSION: "initializeSession",
|
INITIALIZE_SESSION: "initializeSession",
|
||||||
LOG_PART_QUESTIONS: "logPartQuestions",
|
LOG_PART_QUESTIONS: "logPartQuestions",
|
||||||
LOG_DIGITALCONSUMER: "logDigitalConsumer",
|
|
||||||
LOG_FMG_SESSION_DATA: "logFmgSessionData",
|
LOG_FMG_SESSION_DATA: "logFmgSessionData",
|
||||||
|
|
||||||
// DEPENDENCY MUTATIONS
|
// DEPENDENCY MUTATIONS
|
||||||
|
|
@ -115,6 +114,7 @@ const storeActions = {
|
||||||
SAVE_IS_RECAL_ACKNOWLEDGED_FOR_SCHEDULING: "saveIsRecalAcknowledgedForScheduling",
|
SAVE_IS_RECAL_ACKNOWLEDGED_FOR_SCHEDULING: "saveIsRecalAcknowledgedForScheduling",
|
||||||
SAVE_IS_OEM_GLASS_SELECTED: "saveIsOemGlassSelected",
|
SAVE_IS_OEM_GLASS_SELECTED: "saveIsOemGlassSelected",
|
||||||
SAVE_IS_MSR_FEE_APPLICABLE: "saveIsMSRFeeApplicable",
|
SAVE_IS_MSR_FEE_APPLICABLE: "saveIsMSRFeeApplicable",
|
||||||
|
SAVE_IS_MSR_FEE_COVERED_BY_INSURANCE: "saveIsMSRFeeCoveredByInsurance",
|
||||||
|
|
||||||
CREATE_SUBMITTED_STATE: "createSubmittedState",
|
CREATE_SUBMITTED_STATE: "createSubmittedState",
|
||||||
RESET_SUBMITTED_STATE: "resetSubmittedState",
|
RESET_SUBMITTED_STATE: "resetSubmittedState",
|
||||||
|
|
|
||||||
|
|
@ -72,6 +72,7 @@ const storeMutations = {
|
||||||
UPDATE_IS_RECAL_ACKNOWLEDGED_FOR_SCHEDULING: "updateIsRecalAcknowledgedForScheduling",
|
UPDATE_IS_RECAL_ACKNOWLEDGED_FOR_SCHEDULING: "updateIsRecalAcknowledgedForScheduling",
|
||||||
UPDATE_IS_OEM_GLASS_SELECTED: "updateIsOemGlassSelected",
|
UPDATE_IS_OEM_GLASS_SELECTED: "updateIsOemGlassSelected",
|
||||||
UPDATE_IS_MSR_FEE_APPLICABLE: "updateIsMSRFeeApplicable",
|
UPDATE_IS_MSR_FEE_APPLICABLE: "updateIsMSRFeeApplicable",
|
||||||
|
UPDATE_IS_MSR_FEE_COVERED_BY_INSURANCE: "updateIsMSRFeeCoveredByInsurance",
|
||||||
UPDATE_CASH_PRICE_SUBTOTAL: "updateCashPriceSubTotal",
|
UPDATE_CASH_PRICE_SUBTOTAL: "updateCashPriceSubTotal",
|
||||||
|
|
||||||
// EVENT BUS MUTATIONS
|
// EVENT BUS MUTATIONS
|
||||||
|
|
|
||||||
|
|
@ -77,7 +77,7 @@
|
||||||
i % 2 == 0 ? 'even' : 'odd',
|
i % 2 == 0 ? 'even' : 'odd',
|
||||||
cartItem.isRemovable ? 'removable-cart-item' : '',
|
cartItem.isRemovable ? 'removable-cart-item' : '',
|
||||||
]">
|
]">
|
||||||
<span v-if="cartItem != recycleFeeCartItem">{{ cartItem.name }}</span>
|
<span v-if="!this.shouldShowInfoIcon(cartItem)">{{ cartItem.name }}</span>
|
||||||
<textLink
|
<textLink
|
||||||
v-if="allowItemRemoval && cartItem.isRemovable"
|
v-if="allowItemRemoval && cartItem.isRemovable"
|
||||||
ref="removeLink"
|
ref="removeLink"
|
||||||
|
|
@ -93,6 +93,15 @@
|
||||||
<img :src="infoIcon" alt="Info Icon" class="info-icon" />
|
<img :src="infoIcon" alt="Info Icon" class="info-icon" />
|
||||||
</a>
|
</a>
|
||||||
</span>
|
</span>
|
||||||
|
<span v-if="cartItem == msrFeeCartItem">
|
||||||
|
{{ msrFeeCartItem.name }}
|
||||||
|
<a
|
||||||
|
href="javascript:void(0)"
|
||||||
|
@click="openModal(msrModalCmsWidgetName)"
|
||||||
|
id="msr-fee-cartItem">
|
||||||
|
<img :src="infoIcon" alt="Info Icon" class="info-icon" />
|
||||||
|
</a>
|
||||||
|
</span>
|
||||||
<span
|
<span
|
||||||
v-if="
|
v-if="
|
||||||
!showCoverageAsVerified ||
|
!showCoverageAsVerified ||
|
||||||
|
|
@ -138,6 +147,10 @@
|
||||||
:pageName="pageName"
|
:pageName="pageName"
|
||||||
modalWidgetName="PromoModalWidget"
|
modalWidgetName="PromoModalWidget"
|
||||||
@promoAdded="saveVaps" />
|
@promoAdded="saveVaps" />
|
||||||
|
<removeMsrFeeModal
|
||||||
|
modalWidgetName="RemoveMsrFeeModalWidget"
|
||||||
|
ref="removeMsrFeeModal"
|
||||||
|
@switchToInshop="switchToInshop" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
|
|
@ -153,6 +166,10 @@
|
||||||
<contentGroupModal ref="RecycleModal" cmsWidgetName="RecycleModal">
|
<contentGroupModal ref="RecycleModal" cmsWidgetName="RecycleModal">
|
||||||
<textBlock cmsWidgetName="RecycleTextBlock" />
|
<textBlock cmsWidgetName="RecycleTextBlock" />
|
||||||
</contentGroupModal>
|
</contentGroupModal>
|
||||||
|
<contentGroupModal
|
||||||
|
ref="MSRModal"
|
||||||
|
cmsWidgetName="MSRModal"
|
||||||
|
:customBodyText="msrModalTextBlock"></contentGroupModal>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
@ -162,6 +179,7 @@ import textLink from "@/ux-components/text-link/text-link";
|
||||||
import textBlock from "@/digital-components/text-block/text-block";
|
import textBlock from "@/digital-components/text-block/text-block";
|
||||||
import contentGroupModal from "@/fmg-components/content-group-modal/content-group-modal";
|
import contentGroupModal from "@/fmg-components/content-group-modal/content-group-modal";
|
||||||
import promoModalQuestion from "@/fmg-components/promo-modal-question/promo-modal-question";
|
import promoModalQuestion from "@/fmg-components/promo-modal-question/promo-modal-question";
|
||||||
|
import removeMsrFeeModal from "./remove-msr-fee-modal/remove-msr-fee-modal.vue";
|
||||||
|
|
||||||
// Mixins
|
// Mixins
|
||||||
import baseMixin from "@/mixins/base-mixin.js";
|
import baseMixin from "@/mixins/base-mixin.js";
|
||||||
|
|
@ -183,6 +201,7 @@ import {
|
||||||
getSalesTax,
|
getSalesTax,
|
||||||
getAmountDueWithDonation,
|
getAmountDueWithDonation,
|
||||||
} from "@/helpers/pricing-helper.js";
|
} from "@/helpers/pricing-helper.js";
|
||||||
|
import { formatToUSDollar } from "@/helpers/cms-content-helper";
|
||||||
|
|
||||||
// Constants
|
// Constants
|
||||||
import { partTypeStrings } from "@/constants/part-type-strings";
|
import { partTypeStrings } from "@/constants/part-type-strings";
|
||||||
|
|
@ -191,6 +210,7 @@ import { cartItemTypes } from "@/constants/cart-item-types";
|
||||||
import { coverageStatus, cartItemTypesCoveredByInsurance } from "@/constants/insurance";
|
import { coverageStatus, cartItemTypesCoveredByInsurance } from "@/constants/insurance";
|
||||||
import { experimentSettings } from "@/constants/experiments";
|
import { experimentSettings } from "@/constants/experiments";
|
||||||
import { quotePageDiscountTable } from "@/constants/quote-page-discounts";
|
import { quotePageDiscountTable } from "@/constants/quote-page-discounts";
|
||||||
|
import { partNumberStrings } from "@/constants/part-number-strings";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "cart",
|
name: "cart",
|
||||||
|
|
@ -203,6 +223,7 @@ export default {
|
||||||
pageName: String,
|
pageName: String,
|
||||||
allowItemRemoval: Boolean,
|
allowItemRemoval: Boolean,
|
||||||
recyclingModalCmsWidgetName: String,
|
recyclingModalCmsWidgetName: String,
|
||||||
|
msrModalCmsWidgetName: String,
|
||||||
showAsPaid: Boolean,
|
showAsPaid: Boolean,
|
||||||
isInsurance: Boolean,
|
isInsurance: Boolean,
|
||||||
insuranceDeductible: Number,
|
insuranceDeductible: Number,
|
||||||
|
|
@ -214,6 +235,7 @@ export default {
|
||||||
isExpandedOnLoad: Boolean,
|
isExpandedOnLoad: Boolean,
|
||||||
isCollapsible: { type: Boolean, default: true },
|
isCollapsible: { type: Boolean, default: true },
|
||||||
isMSRFeeApplicable: Boolean,
|
isMSRFeeApplicable: Boolean,
|
||||||
|
IsMSRFeeCoveredByInsurance: Boolean,
|
||||||
donationCartItem: Object,
|
donationCartItem: Object,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
|
|
@ -311,6 +333,10 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
async removeItem(cartItemType, category) {
|
async removeItem(cartItemType, category) {
|
||||||
|
if (cartItemType == cartItemTypes.MOBILE_FEE && this.isMSRFeeApplicable) {
|
||||||
|
this.$refs.removeMsrFeeModal.openModal();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
this.lineItems[category] = this.lineItems[category].filter(
|
this.lineItems[category] = this.lineItems[category].filter(
|
||||||
(lineItemsToKeep) => lineItemsToKeep.cartItemType != cartItemType
|
(lineItemsToKeep) => lineItemsToKeep.cartItemType != cartItemType
|
||||||
);
|
);
|
||||||
|
|
@ -375,6 +401,12 @@ export default {
|
||||||
}
|
}
|
||||||
return [];
|
return [];
|
||||||
},
|
},
|
||||||
|
shouldShowInfoIcon(cartItem) {
|
||||||
|
return cartItem == this.recycleFeeCartItem || cartItem == this.msrFeeCartItem;
|
||||||
|
},
|
||||||
|
switchToInshop() {
|
||||||
|
this.$emit("switchToInshop");
|
||||||
|
},
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
isCartReadyToLoad() {
|
isCartReadyToLoad() {
|
||||||
|
|
@ -490,6 +522,10 @@ export default {
|
||||||
cartItems.push(this.mobileFeeCartItem);
|
cartItems.push(this.mobileFeeCartItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.msrFeeCartItem) {
|
||||||
|
cartItems.push(this.msrFeeCartItem);
|
||||||
|
}
|
||||||
|
|
||||||
if (this.quotePageDiscountCartItem) {
|
if (this.quotePageDiscountCartItem) {
|
||||||
cartItems.push(this.quotePageDiscountCartItem);
|
cartItems.push(this.quotePageDiscountCartItem);
|
||||||
}
|
}
|
||||||
|
|
@ -892,7 +928,9 @@ export default {
|
||||||
let cartItem = null;
|
let cartItem = null;
|
||||||
let showMobileFeeCartItem = false;
|
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 &&
|
||||||
|
lineItem.partNumber == partTypeStrings.MOBILE_FEE
|
||||||
);
|
);
|
||||||
|
|
||||||
var mobileTotal =
|
var mobileTotal =
|
||||||
|
|
@ -929,6 +967,68 @@ export default {
|
||||||
}
|
}
|
||||||
return cartItem;
|
return cartItem;
|
||||||
},
|
},
|
||||||
|
msrFeeCartItemName() {
|
||||||
|
return this.getCmsContent("MSRFeeTextWidget", "Text");
|
||||||
|
},
|
||||||
|
getMsrFeeLineItem() {
|
||||||
|
return this.supportingItems.find(
|
||||||
|
(lineItem) =>
|
||||||
|
lineItem.partType == partTypeStrings.MOBILE_FEE &&
|
||||||
|
lineItem.partNumber == partNumberStrings.MOBILE_STATIC_RECAL_FEE
|
||||||
|
);
|
||||||
|
},
|
||||||
|
msrFeeCartItem() {
|
||||||
|
let cartItem = null;
|
||||||
|
const msrFeeLineItem = this.getMsrFeeLineItem;
|
||||||
|
const shouldCreateMsrFeeCartItem =
|
||||||
|
this.isMSRFeeApplicable &&
|
||||||
|
this.isInsurance &&
|
||||||
|
!this.IsMSRFeeCoveredByInsurance &&
|
||||||
|
msrFeeLineItem &&
|
||||||
|
this.msrFeeAmount > 0;
|
||||||
|
|
||||||
|
if (shouldCreateMsrFeeCartItem) {
|
||||||
|
cartItem = {
|
||||||
|
name: this.msrFeeCartItemName,
|
||||||
|
category: cartItemCategories.SUPPORTING_ITEMS,
|
||||||
|
cartItemType: cartItemTypes.MOBILE_FEE,
|
||||||
|
isDisplayed: this.isInsurance,
|
||||||
|
isRemovable: true,
|
||||||
|
subTotal: 0,
|
||||||
|
salesTax: 0,
|
||||||
|
lineItems: [],
|
||||||
|
isCoveredByInsurance: this.IsMSRFeeCoveredByInsurance,
|
||||||
|
};
|
||||||
|
msrFeeLineItem.cartItemType = cartItem.cartItemType;
|
||||||
|
cartItem.lineItems.push(msrFeeLineItem);
|
||||||
|
cartItem.subTotal += this.msrFeeAmount;
|
||||||
|
cartItem.salesTax += msrFeeLineItem.salesTax ?? 0;
|
||||||
|
}
|
||||||
|
return cartItem;
|
||||||
|
},
|
||||||
|
msrFeeAmount() {
|
||||||
|
const msrFeeLineItem = this.getMsrFeeLineItem;
|
||||||
|
if (!msrFeeLineItem) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return (
|
||||||
|
msrFeeLineItem.laborAmount + msrFeeLineItem.sellingPrice + msrFeeLineItem.kitPrice
|
||||||
|
);
|
||||||
|
},
|
||||||
|
msrModalTextBlock() {
|
||||||
|
let cmsContentText = this.getCmsContent("MSRModal", "BodyText");
|
||||||
|
if (cmsContentText) {
|
||||||
|
cmsContentText = cmsContentText.replaceAll(
|
||||||
|
"{custom:mobileFee}",
|
||||||
|
formatToUSDollar(this.msrFeeAmount)
|
||||||
|
);
|
||||||
|
cmsContentText = cmsContentText.replaceAll(
|
||||||
|
"{custom:submittedOrder.policy.insuranceCompanyName}",
|
||||||
|
this.insuranceCompanyName
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return cmsContentText;
|
||||||
|
},
|
||||||
quotePageDiscountCartItemName() {
|
quotePageDiscountCartItemName() {
|
||||||
return this.getCmsContent("ServicePackageDiscountTextWidget", "Text");
|
return this.getCmsContent("ServicePackageDiscountTextWidget", "Text");
|
||||||
},
|
},
|
||||||
|
|
@ -1189,6 +1289,7 @@ export default {
|
||||||
textLink,
|
textLink,
|
||||||
contentGroupModal,
|
contentGroupModal,
|
||||||
promoModalQuestion,
|
promoModalQuestion,
|
||||||
|
removeMsrFeeModal,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
@ -1289,6 +1390,10 @@ export default {
|
||||||
order: 3;
|
order: 3;
|
||||||
margin-right: 100%;
|
margin-right: 100%;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
|
|
||||||
|
&#msr-fee-cartItem {
|
||||||
|
margin: 0 0 0 0.2rem;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.package-type,
|
.package-type,
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,153 @@
|
||||||
|
<template>
|
||||||
|
<div id="msr-fee-modal-container">
|
||||||
|
<modal
|
||||||
|
:ref="modalName"
|
||||||
|
:headerText="modalHeaderText"
|
||||||
|
suppressPageScroll
|
||||||
|
:onModalClosedCallback="onModalClosed"
|
||||||
|
:footerButtonText="modalFooterText"
|
||||||
|
:isFooterButtonPrimary="true"
|
||||||
|
@footer-button-event="switchToInshop"
|
||||||
|
@isModalOpened="setIsModalOpen">
|
||||||
|
<p class="modal-body-inner" v-html="modalBodyText"></p>
|
||||||
|
<template v-slot:modal-header-slot>
|
||||||
|
<span>{{ modalSubHeaderText }}</span>
|
||||||
|
</template>
|
||||||
|
<template v-slot:modal-footer-slot>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
class="btn btn-link"
|
||||||
|
id="cancel-button"
|
||||||
|
:disabled="isLoading"
|
||||||
|
@click="closeModal">
|
||||||
|
{{ buttonText }}
|
||||||
|
</button>
|
||||||
|
</template>
|
||||||
|
</modal>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
// Supporting files
|
||||||
|
import modal from "@/digital-components/modal/modal";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "remove-msr-fee-modal",
|
||||||
|
props: {
|
||||||
|
cmsWidgetName: String,
|
||||||
|
modalWidgetName: String,
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
isModalOpen: false,
|
||||||
|
switchedToInshop: false,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
openModal() {
|
||||||
|
this.modal.openModal();
|
||||||
|
},
|
||||||
|
onModalClosed() {
|
||||||
|
this.$emit("close-remove-msr-fee-modal");
|
||||||
|
this.switchedToInshop = false;
|
||||||
|
},
|
||||||
|
closeModal() {
|
||||||
|
this.modal.closeModal();
|
||||||
|
},
|
||||||
|
getIsModalOpen() {
|
||||||
|
return this.isModalOpen;
|
||||||
|
},
|
||||||
|
setIsModalOpen(isOpen) {
|
||||||
|
this.isModalOpen = isOpen;
|
||||||
|
},
|
||||||
|
switchToInshop() {
|
||||||
|
this.switchedToInshop = true;
|
||||||
|
this.$emit("switchToInshop");
|
||||||
|
this.modal.closeModal();
|
||||||
|
},
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
modalName() {
|
||||||
|
return this.modalWidgetName;
|
||||||
|
},
|
||||||
|
modal() {
|
||||||
|
return this.$refs[this.modalName];
|
||||||
|
},
|
||||||
|
modalSubHeaderText() {
|
||||||
|
return this.getCmsContent(this.modalWidgetName, "SubheaderText");
|
||||||
|
},
|
||||||
|
modalHeaderText() {
|
||||||
|
return this.getCmsContent(this.modalWidgetName, "HeaderText");
|
||||||
|
},
|
||||||
|
modalBodyText() {
|
||||||
|
return this.getCmsContent(this.modalWidgetName, "BodyText");
|
||||||
|
},
|
||||||
|
modalFooterText() {
|
||||||
|
return this.getCmsContent(this.modalWidgetName, "FooterText");
|
||||||
|
},
|
||||||
|
buttonText() {
|
||||||
|
return this.getCmsContent(this.modalWidgetName, "FooterText2");
|
||||||
|
},
|
||||||
|
},
|
||||||
|
components: { modal },
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style lang="scss">
|
||||||
|
#msr-fee-modal-container {
|
||||||
|
.modal-component {
|
||||||
|
@include media-breakpoint-up(md) {
|
||||||
|
.modal-dialog {
|
||||||
|
left: 0;
|
||||||
|
align-content: center;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
width: 22.063rem;
|
||||||
|
transform: translate(0, 0);
|
||||||
|
|
||||||
|
.modal-content {
|
||||||
|
border-radius: $border-radius-lg;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.modal-dialog {
|
||||||
|
.modal-content {
|
||||||
|
.modal-header {
|
||||||
|
flex-direction: column;
|
||||||
|
& > span {
|
||||||
|
color: $red;
|
||||||
|
font-size: $font-size-14;
|
||||||
|
font-weight: $font-weight-600;
|
||||||
|
text-transform: uppercase;
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal-title {
|
||||||
|
font-size: $font-size-20;
|
||||||
|
font-weight: $font-weight-normal;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.modal-body {
|
||||||
|
padding: 0.5rem 1rem;
|
||||||
|
|
||||||
|
.modal-body-inner {
|
||||||
|
ul {
|
||||||
|
list-style: none;
|
||||||
|
padding: 1rem;
|
||||||
|
background-color: #f4f4f4;
|
||||||
|
font-size: $font-size-14;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.modal-footer {
|
||||||
|
flex-flow: wrap-reverse;
|
||||||
|
|
||||||
|
#cancel-button {
|
||||||
|
width: 100%;
|
||||||
|
text-decoration: none;
|
||||||
|
margin-top: 1.5rem;
|
||||||
|
font-weight: $font-weight-600;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -26,6 +26,7 @@ export default {
|
||||||
name: "content-group-modal",
|
name: "content-group-modal",
|
||||||
props: {
|
props: {
|
||||||
cmsWidgetName: String,
|
cmsWidgetName: String,
|
||||||
|
customBodyText: String,
|
||||||
footerButtonActionName: {
|
footerButtonActionName: {
|
||||||
type: String,
|
type: String,
|
||||||
default: null,
|
default: null,
|
||||||
|
|
@ -43,6 +44,9 @@ export default {
|
||||||
return this.getCmsContent(this.cmsWidgetName, "SubheaderText");
|
return this.getCmsContent(this.cmsWidgetName, "SubheaderText");
|
||||||
},
|
},
|
||||||
ModalBodyText() {
|
ModalBodyText() {
|
||||||
|
if (this.customBodyText) {
|
||||||
|
return this.customBodyText;
|
||||||
|
}
|
||||||
return this.getCmsContent(this.cmsWidgetName, "BodyText");
|
return this.getCmsContent(this.cmsWidgetName, "BodyText");
|
||||||
},
|
},
|
||||||
ModalSubBodyText() {
|
ModalSubBodyText() {
|
||||||
|
|
|
||||||
|
|
@ -102,7 +102,6 @@ export default {
|
||||||
},
|
},
|
||||||
(error) => {
|
(error) => {
|
||||||
if (
|
if (
|
||||||
endpoint.toLowerCase().includes(endpoints.LogDigitalConsumer.url) ||
|
|
||||||
endpoint.toLowerCase().includes(endpoints.LogFmgSessionData.url) ||
|
endpoint.toLowerCase().includes(endpoints.LogFmgSessionData.url) ||
|
||||||
endpoint.toLowerCase().includes(endpoints.LogPageView.url) ||
|
endpoint.toLowerCase().includes(endpoints.LogPageView.url) ||
|
||||||
endpoint.toLowerCase().includes(endpoints.LogCustomEvent.url) ||
|
endpoint.toLowerCase().includes(endpoints.LogCustomEvent.url) ||
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ import store from "@/store";
|
||||||
import { storeActions } from "@/constants/store-actions";
|
import { storeActions } from "@/constants/store-actions";
|
||||||
import baseMixin from "@/mixins/base-mixin.js";
|
import baseMixin from "@/mixins/base-mixin.js";
|
||||||
import { deepClone } from "@/helpers/object-helper";
|
import { deepClone } from "@/helpers/object-helper";
|
||||||
|
import { partNumberStrings } from "@/constants/part-number-strings";
|
||||||
|
|
||||||
export function getDisplayAmountDue(lineItemsObject, includeTax = true) {
|
export function getDisplayAmountDue(lineItemsObject, includeTax = true) {
|
||||||
return getAmountDue(lineItemsObject, includeTax).toLocaleString("en-US", {
|
return getAmountDue(lineItemsObject, includeTax).toLocaleString("en-US", {
|
||||||
|
|
@ -32,6 +33,10 @@ export function getAmountDue(lineItemsObject, includeTax = true) {
|
||||||
|
|
||||||
if (store.getters.coverageIsVerified && !order.policy.isNoComp && !order.policy.isItac) {
|
if (store.getters.coverageIsVerified && !order.policy.isNoComp && !order.policy.isItac) {
|
||||||
amountDue = order.policy.currentDeductible;
|
amountDue = order.policy.currentDeductible;
|
||||||
|
|
||||||
|
if (order.isMSRFeeApplicable && !order.isMSRFeeCoveredByInsurance) {
|
||||||
|
amountDue += getMSRFeePartPrice(lineItemsObject?.supportingItems, includeTax);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lineItemsObject?.vaps) {
|
if (lineItemsObject?.vaps) {
|
||||||
|
|
@ -100,6 +105,20 @@ export async function getPricingByDayPartWithPrice(pageNameToLog) {
|
||||||
return pricingResults[0];
|
return pricingResults[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function getMSRFeePartPrice(supportingItems, includeTax) {
|
||||||
|
let msrFeePrice = 0;
|
||||||
|
const msrFeeLineItem = supportingItems?.find(
|
||||||
|
(lineItem) => lineItem.partNumber === partNumberStrings.MOBILE_STATIC_RECAL_FEE
|
||||||
|
);
|
||||||
|
if (msrFeeLineItem) {
|
||||||
|
msrFeePrice = baseMixin?.methods?.getTotalPriceOfAllLineItemsAndChildParts(
|
||||||
|
[msrFeeLineItem],
|
||||||
|
includeTax
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return msrFeePrice;
|
||||||
|
}
|
||||||
|
|
||||||
export function addPricesToLineItems(lineItems, pricingLineItems) {
|
export function addPricesToLineItems(lineItems, pricingLineItems) {
|
||||||
lineItems.forEach((lineItem) => {
|
lineItems.forEach((lineItem) => {
|
||||||
const lineItemIndex = pricingLineItems.findIndex(
|
const lineItemIndex = pricingLineItems.findIndex(
|
||||||
|
|
|
||||||
|
|
@ -62,6 +62,7 @@
|
||||||
:showAsPaid="isPia"
|
:showAsPaid="isPia"
|
||||||
servicePackageOptionsCmsName="ServicePackageTitle"
|
servicePackageOptionsCmsName="ServicePackageTitle"
|
||||||
recyclingModalCmsWidgetName="RecycleModal"
|
recyclingModalCmsWidgetName="RecycleModal"
|
||||||
|
msrModalCmsWidgetName="MSRModal"
|
||||||
:isInsurance="isInsurance"
|
:isInsurance="isInsurance"
|
||||||
:insuranceDeductible="currentDeductible"
|
:insuranceDeductible="currentDeductible"
|
||||||
:insuranceCompanyName="insuranceCompanyName"
|
:insuranceCompanyName="insuranceCompanyName"
|
||||||
|
|
@ -70,7 +71,8 @@
|
||||||
:isItac="isItac"
|
:isItac="isItac"
|
||||||
:isNoComp="isNoComp"
|
:isNoComp="isNoComp"
|
||||||
:isExpandedOnLoad="false"
|
:isExpandedOnLoad="false"
|
||||||
:isMSRFeeApplicable="isMSRFeeApplicable" />
|
:isMSRFeeApplicable="isMSRFeeApplicable"
|
||||||
|
:IsMSRFeeCoveredByInsurance="isMSRFeeCoveredByInsurance" />
|
||||||
|
|
||||||
<hr class="mb-5" />
|
<hr class="mb-5" />
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -419,6 +421,9 @@ export default {
|
||||||
isMSRFeeApplicable() {
|
isMSRFeeApplicable() {
|
||||||
return this.submittedOrder?.isMSRFeeApplicable;
|
return this.submittedOrder?.isMSRFeeApplicable;
|
||||||
},
|
},
|
||||||
|
isMSRFeeCoveredByInsurance() {
|
||||||
|
return this.submittedOrder?.isMSRFeeCoveredByInsurance;
|
||||||
|
},
|
||||||
isInsurance() {
|
isInsurance() {
|
||||||
return this.submittedOrder?.payment?.isInsurance;
|
return this.submittedOrder?.payment?.isInsurance;
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -62,6 +62,7 @@ import baseMixin from "@/mixins/base-mixin.js";
|
||||||
import { queryStrings } from "@/constants/query-strings";
|
import { queryStrings } from "@/constants/query-strings";
|
||||||
import { nextTick } from "vue";
|
import { nextTick } from "vue";
|
||||||
import { peekQueryFromStash } from "@/router/methods/helpers/querystring-stash";
|
import { peekQueryFromStash } from "@/router/methods/helpers/querystring-stash";
|
||||||
|
import { showFmgLoadingModal } from "@/helpers/loading-modal-helper";
|
||||||
|
|
||||||
// Define Validation Rules
|
// Define Validation Rules
|
||||||
defineRule("zip-required", required(errorMessages.SERVICE_ZIP_REQUIRED));
|
defineRule("zip-required", required(errorMessages.SERVICE_ZIP_REQUIRED));
|
||||||
|
|
@ -169,7 +170,7 @@ export default {
|
||||||
baseMixin.methods.ResetExternalParamsAndHideModal();
|
baseMixin.methods.ResetExternalParamsAndHideModal();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
baseMixin.methods.ResetExternalParamsAndHideModal();
|
showFmgLoadingModal(false);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
baseMixin.methods.ResetExternalParamsAndHideModal();
|
baseMixin.methods.ResetExternalParamsAndHideModal();
|
||||||
|
|
|
||||||
|
|
@ -29,10 +29,12 @@
|
||||||
v-model="lineItems"
|
v-model="lineItems"
|
||||||
servicePackageOptionsCmsName="ServicePackageTitle"
|
servicePackageOptionsCmsName="ServicePackageTitle"
|
||||||
recyclingModalCmsWidgetName="RecycleModal"
|
recyclingModalCmsWidgetName="RecycleModal"
|
||||||
|
msrModalCmsWidgetName="MSRModal"
|
||||||
:isInsurance="isInsurance"
|
:isInsurance="isInsurance"
|
||||||
:insuranceDeductible="currentDeductible"
|
:insuranceDeductible="currentDeductible"
|
||||||
:insuranceCompanyName="insuranceCompanyName"
|
:insuranceCompanyName="insuranceCompanyName"
|
||||||
:showInsuranceCoverageAs="showInsuranceCoverageAs"
|
:showInsuranceCoverageAs="showInsuranceCoverageAs"
|
||||||
|
:isMSRFeeApplicable="isMSRFeeApplicable"
|
||||||
:isItac="isItac"
|
:isItac="isItac"
|
||||||
:isNoComp="isNoComp"
|
:isNoComp="isNoComp"
|
||||||
:isCollapsible="false" />
|
:isCollapsible="false" />
|
||||||
|
|
@ -568,6 +570,9 @@ export default {
|
||||||
insuranceCompanyName() {
|
insuranceCompanyName() {
|
||||||
return this.$store.getters.policy.insuranceCompanyName;
|
return this.$store.getters.policy.insuranceCompanyName;
|
||||||
},
|
},
|
||||||
|
isMSRFeeApplicable() {
|
||||||
|
return this.$store.getters.order.isMSRFeeApplicable;
|
||||||
|
},
|
||||||
lineItems() {
|
lineItems() {
|
||||||
return deepClone(this.$store.getters.lineItems);
|
return deepClone(this.$store.getters.lineItems);
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@
|
||||||
pageName="payment-method"
|
pageName="payment-method"
|
||||||
servicePackageOptionsCmsName="ServicePackageTitle"
|
servicePackageOptionsCmsName="ServicePackageTitle"
|
||||||
recyclingModalCmsWidgetName="RecycleModal"
|
recyclingModalCmsWidgetName="RecycleModal"
|
||||||
|
msrModalCmsWidgetName="MSRModal"
|
||||||
:isInsurance="isInsurance"
|
:isInsurance="isInsurance"
|
||||||
:insuranceDeductible="currentDeductible"
|
:insuranceDeductible="currentDeductible"
|
||||||
:insuranceCompanyName="insuranceCompanyName"
|
:insuranceCompanyName="insuranceCompanyName"
|
||||||
|
|
@ -35,7 +36,9 @@
|
||||||
:isNoComp="isNoComp"
|
:isNoComp="isNoComp"
|
||||||
:isExpandedOnLoad="false"
|
:isExpandedOnLoad="false"
|
||||||
:isMSRFeeApplicable="isMSRFeeApplicable"
|
:isMSRFeeApplicable="isMSRFeeApplicable"
|
||||||
@itemRemoved="evaluatePromosAndTaxItemsOnOrder" />
|
:IsMSRFeeCoveredByInsurance="isMSRFeeCoveredByInsurance"
|
||||||
|
@itemRemoved="evaluatePromosAndTaxItemsOnOrder"
|
||||||
|
@switchToInshop="navigateToSchedulePage" />
|
||||||
|
|
||||||
<afterpayBreakout
|
<afterpayBreakout
|
||||||
v-if="isAfterpayBreakoutDisplay"
|
v-if="isAfterpayBreakoutDisplay"
|
||||||
|
|
@ -214,6 +217,7 @@ export default {
|
||||||
name: "paymentMethod",
|
name: "paymentMethod",
|
||||||
props: {
|
props: {
|
||||||
recyclingModalCmsWidgetName: String,
|
recyclingModalCmsWidgetName: String,
|
||||||
|
msrModalCmsWidgetName: String,
|
||||||
},
|
},
|
||||||
async beforeRouteEnter(to, from, next) {
|
async beforeRouteEnter(to, from, next) {
|
||||||
// Call APIs
|
// Call APIs
|
||||||
|
|
@ -607,6 +611,13 @@ export default {
|
||||||
openModal(modalName) {
|
openModal(modalName) {
|
||||||
this.$refs[modalName].openModal();
|
this.$refs[modalName].openModal();
|
||||||
},
|
},
|
||||||
|
async navigateToSchedulePage() {
|
||||||
|
this.$refs.loadingModal.showModal();
|
||||||
|
this.$router.navigateWithSaving(
|
||||||
|
this.navigationScenarios.CLICKED_SWITCH_TO_INSHOP,
|
||||||
|
this.pageName
|
||||||
|
);
|
||||||
|
},
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
AppointmentType() {
|
AppointmentType() {
|
||||||
|
|
@ -682,6 +693,9 @@ export default {
|
||||||
isMSRFeeApplicable() {
|
isMSRFeeApplicable() {
|
||||||
return this.$store.getters.order.isMSRFeeApplicable;
|
return this.$store.getters.order.isMSRFeeApplicable;
|
||||||
},
|
},
|
||||||
|
isMSRFeeCoveredByInsurance() {
|
||||||
|
return this.$store.getters.order.isMSRFeeCoveredByInsurance;
|
||||||
|
},
|
||||||
isInsurance() {
|
isInsurance() {
|
||||||
return this.hasSubmittedOrder()
|
return this.hasSubmittedOrder()
|
||||||
? this.getSubmittedOrder()?.payment.isInsurance
|
? this.getSubmittedOrder()?.payment.isInsurance
|
||||||
|
|
|
||||||
|
|
@ -47,10 +47,12 @@
|
||||||
v-model="lineItems"
|
v-model="lineItems"
|
||||||
servicePackageOptionsCmsName="ServicePackageTitle"
|
servicePackageOptionsCmsName="ServicePackageTitle"
|
||||||
recyclingModalCmsWidgetName="RecycleModal"
|
recyclingModalCmsWidgetName="RecycleModal"
|
||||||
|
msrModalCmsWidgetName="MSRModal"
|
||||||
:isInsurance="isInsurance"
|
:isInsurance="isInsurance"
|
||||||
:insuranceDeductible="currentDeductible"
|
:insuranceDeductible="currentDeductible"
|
||||||
:insuranceCompanyName="insuranceCompanyName"
|
:insuranceCompanyName="insuranceCompanyName"
|
||||||
:showInsuranceCoverageAs="showInsuranceCoverageAs"
|
:showInsuranceCoverageAs="showInsuranceCoverageAs"
|
||||||
|
:isMSRFeeApplicable="isMSRFeeApplicable"
|
||||||
:isItac="isItac"
|
:isItac="isItac"
|
||||||
:isNoComp="isNoComp"
|
:isNoComp="isNoComp"
|
||||||
:isCollapsible="false" />
|
:isCollapsible="false" />
|
||||||
|
|
@ -410,6 +412,9 @@ export default {
|
||||||
insuranceCompanyName() {
|
insuranceCompanyName() {
|
||||||
return this.$store.getters.policy.insuranceCompanyName;
|
return this.$store.getters.policy.insuranceCompanyName;
|
||||||
},
|
},
|
||||||
|
isMSRFeeApplicable() {
|
||||||
|
return this.$store.getters.order.isMSRFeeApplicable;
|
||||||
|
},
|
||||||
isPaypal() {
|
isPaypal() {
|
||||||
if (this.paymentType == "pp") {
|
if (this.paymentType == "pp") {
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
|
|
@ -590,12 +590,6 @@ export default {
|
||||||
}
|
}
|
||||||
// there are no active or inactive external parameters; use internal threshold
|
// there are no active or inactive external parameters; use internal threshold
|
||||||
if (internalThreshold) thresholdToUse = internalThreshold;
|
if (internalThreshold) thresholdToUse = internalThreshold;
|
||||||
|
|
||||||
vm.isInsuranceSelected = getIsInsuranceSelectedValue(
|
|
||||||
vm.availableLineItems,
|
|
||||||
thresholdToUse
|
|
||||||
);
|
|
||||||
baseMixin.methods.ResetExternalParamsAndHideModal();
|
|
||||||
} else {
|
} else {
|
||||||
// user came from an external source, however, the externalParms may have been reset on service-zip, property-questions, etc...
|
// user came from an external source, however, the externalParms may have been reset on service-zip, property-questions, etc...
|
||||||
if (getBoolFromString(store.getters.externalParameterQuote?.isInsurance)) {
|
if (getBoolFromString(store.getters.externalParameterQuote?.isInsurance)) {
|
||||||
|
|
@ -613,8 +607,6 @@ export default {
|
||||||
) {
|
) {
|
||||||
await vm.skip(insuranceSelection, servicePackage);
|
await vm.skip(insuranceSelection, servicePackage);
|
||||||
}
|
}
|
||||||
|
|
||||||
baseMixin.methods.ResetExternalParamsAndHideModal();
|
|
||||||
} else {
|
} else {
|
||||||
if (externalThreshold) thresholdToUse = externalThreshold;
|
if (externalThreshold) thresholdToUse = externalThreshold;
|
||||||
|
|
||||||
|
|
@ -622,15 +614,17 @@ export default {
|
||||||
{
|
{
|
||||||
debugLog("quote.vue tab select NOT EXTERNAL");
|
debugLog("quote.vue tab select NOT EXTERNAL");
|
||||||
}
|
}
|
||||||
|
|
||||||
vm.isInsuranceSelected = getIsInsuranceSelectedValue(
|
|
||||||
vm.availableLineItems,
|
|
||||||
thresholdToUse
|
|
||||||
);
|
|
||||||
baseMixin.methods.ResetExternalParamsAndHideModal();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (vm.isInsuranceSelected == null) {
|
||||||
|
vm.isInsuranceSelected = getIsInsuranceSelectedValue(
|
||||||
|
vm.availableLineItems,
|
||||||
|
thresholdToUse
|
||||||
|
);
|
||||||
|
}
|
||||||
|
baseMixin.methods.ResetExternalParamsAndHideModal();
|
||||||
|
|
||||||
if (vm.skipToInsurance && !vm.showSaveProgressPopup) {
|
if (vm.skipToInsurance && !vm.showSaveProgressPopup) {
|
||||||
// skip ahead only if no email popup.
|
// skip ahead only if no email popup.
|
||||||
await vm.skip(true, externalParamPackageLabels.GLASS_ONLY);
|
await vm.skip(true, externalParamPackageLabels.GLASS_ONLY);
|
||||||
|
|
|
||||||
|
|
@ -704,8 +704,11 @@ export default {
|
||||||
},
|
},
|
||||||
isMobileStaticRecalibrationApplicable() {
|
isMobileStaticRecalibrationApplicable() {
|
||||||
return (
|
return (
|
||||||
this.displayMSR &&
|
(this.displayMSR &&
|
||||||
this.mobileFeePart?.partNumber == partNumberStrings.MOBILE_STATIC_RECAL_FEE
|
this.mobileFeePart?.partNumber == partNumberStrings.MOBILE_STATIC_RECAL_FEE &&
|
||||||
|
this.enableMSRSplitPay) ||
|
||||||
|
this.isCashItacNoComp ||
|
||||||
|
this.mobileFeePart?.isInsurable
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
displayMSR() {
|
displayMSR() {
|
||||||
|
|
@ -715,6 +718,13 @@ export default {
|
||||||
?.toLowerCase() === "true"
|
?.toLowerCase() === "true"
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
enableMSRSplitPay() {
|
||||||
|
return (
|
||||||
|
experimentMixin.methods
|
||||||
|
.getSettingValue(experimentSettings.ENABLE_MSR_SPLIT_PAY)
|
||||||
|
?.toLowerCase() === "true"
|
||||||
|
);
|
||||||
|
},
|
||||||
isMSRFeeNotCoveredByInsurance() {
|
isMSRFeeNotCoveredByInsurance() {
|
||||||
return (
|
return (
|
||||||
this.isMobileSelected &&
|
this.isMobileSelected &&
|
||||||
|
|
@ -1173,6 +1183,13 @@ export default {
|
||||||
isMSRFeeApplicable
|
isMSRFeeApplicable
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
updateAndSaveIsMSRFeeCoveredByInsurance() {
|
||||||
|
const isMSRFeeCoveredByInsurance = this.mobileFeePart?.isInsurable;
|
||||||
|
this.dispatchStoreAction(
|
||||||
|
this.storeActions.SAVE_IS_MSR_FEE_COVERED_BY_INSURANCE,
|
||||||
|
isMSRFeeCoveredByInsurance
|
||||||
|
);
|
||||||
|
},
|
||||||
updateAndSaveSupportingItems() {
|
updateAndSaveSupportingItems() {
|
||||||
let supportingItems = store.getters.lineItems.supportingItems;
|
let supportingItems = store.getters.lineItems.supportingItems;
|
||||||
let shouldSaveSupportingItems = false;
|
let shouldSaveSupportingItems = false;
|
||||||
|
|
@ -1528,6 +1545,7 @@ export default {
|
||||||
|
|
||||||
this.updateAndSaveSupportingItems();
|
this.updateAndSaveSupportingItems();
|
||||||
this.updateAndSaveIsMSRFeeApplicable();
|
this.updateAndSaveIsMSRFeeApplicable();
|
||||||
|
this.updateAndSaveIsMSRFeeCoveredByInsurance();
|
||||||
|
|
||||||
this.updateSupportingItems();
|
this.updateSupportingItems();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -80,6 +80,7 @@ import { saveSession } from "@/helpers/heritage-integration/order-helper.js";
|
||||||
import baseMixin from "@/mixins/base-mixin.js";
|
import baseMixin from "@/mixins/base-mixin.js";
|
||||||
import { queryStrings } from "@/constants/query-strings";
|
import { queryStrings } from "@/constants/query-strings";
|
||||||
import { routeData } from "@/router/constants/routes";
|
import { routeData } from "@/router/constants/routes";
|
||||||
|
import { showFmgLoadingModal } from "@/helpers/loading-modal-helper";
|
||||||
|
|
||||||
// Define Validation Rules
|
// Define Validation Rules
|
||||||
defineRule("zip-required", required(errorMessages.SERVICE_ZIP_REQUIRED));
|
defineRule("zip-required", required(errorMessages.SERVICE_ZIP_REQUIRED));
|
||||||
|
|
@ -137,6 +138,13 @@ export default {
|
||||||
},
|
},
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
|
vm.serviceZipCode = store.getters.externalParameterServiceZip.zipCode;
|
||||||
|
const isValid = await baseMixin.methods.isFormValid(vm.$refs.theForm);
|
||||||
|
if (isValid) {
|
||||||
|
showFmgLoadingModal(true);
|
||||||
|
vm.forwardButtonAction();
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (store.getters.externalParameterCustomer?.phoneNumber) {
|
if (store.getters.externalParameterCustomer?.phoneNumber) {
|
||||||
|
|
|
||||||
|
|
@ -93,6 +93,7 @@ import { errorMessages } from "@/constants/error-messages";
|
||||||
import { damageLocationsCms } from "@/constants/damage-locations-cms.js";
|
import { damageLocationsCms } from "@/constants/damage-locations-cms.js";
|
||||||
import { damageLocationsSelected } from "@/constants/damage-locations-selected.js";
|
import { damageLocationsSelected } from "@/constants/damage-locations-selected.js";
|
||||||
import { getFunnelCookie } from "@/helpers/heritage-integration/cookie-helper";
|
import { getFunnelCookie } from "@/helpers/heritage-integration/cookie-helper";
|
||||||
|
import { showFmgLoadingModal } from "@/helpers/loading-modal-helper";
|
||||||
import { debugLog } from "@/helpers/debug-log-helper";
|
import { debugLog } from "@/helpers/debug-log-helper";
|
||||||
|
|
||||||
import store from "@/store";
|
import store from "@/store";
|
||||||
|
|
@ -199,7 +200,7 @@ export default {
|
||||||
return vm.forwardButtonAction();
|
return vm.forwardButtonAction();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
baseMixin.methods.ResetExternalParamsAndHideModal();
|
showFmgLoadingModal(false);
|
||||||
|
|
||||||
//clear any validation errors for external parameter flow
|
//clear any validation errors for external parameter flow
|
||||||
const form = vm.$refs.theForm;
|
const form = vm.$refs.theForm;
|
||||||
|
|
@ -209,7 +210,7 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
baseMixin.methods.ResetExternalParamsAndHideModal();
|
showFmgLoadingModal(false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -93,8 +93,11 @@ describe("vehicle.vue", () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("vehicle.vue", () => {
|
describe("vehicle.vue", () => {
|
||||||
test("should call forwardButtonAction if isExternalParameter is true and form is valid", async () => {
|
test("should call forwardButtonAction if isExternalParameter is true, has a year, make and model, and form is valid", async () => {
|
||||||
store.getters.externalParameterState.isExternalParameter = true;
|
store.getters.externalParameterState.isExternalParameter = true;
|
||||||
|
store.getters.externalParameterVehicle.year = "1886";
|
||||||
|
store.getters.externalParameterVehicle.make = "Benz";
|
||||||
|
store.getters.externalParameterVehicle.model = "Patent-Motorwagen";
|
||||||
// Create a shallow mount of MyComponent
|
// Create a shallow mount of MyComponent
|
||||||
const { wrapper } = setupMocks();
|
const { wrapper } = setupMocks();
|
||||||
// Set displayNoServiceAlert to false
|
// Set displayNoServiceAlert to false
|
||||||
|
|
|
||||||
|
|
@ -109,6 +109,7 @@ import { getFunnelCookie } from "@/helpers/heritage-integration/cookie-helper";
|
||||||
import { applicationConfig } from "../../constants/application-config";
|
import { applicationConfig } from "../../constants/application-config";
|
||||||
import { queryStrings } from "@/constants/query-strings";
|
import { queryStrings } from "@/constants/query-strings";
|
||||||
import { getQuerystringParameter } from "@/helpers/querystring-helper";
|
import { getQuerystringParameter } from "@/helpers/querystring-helper";
|
||||||
|
import { showFmgLoadingModal } from "@/helpers/loading-modal-helper";
|
||||||
import { debugLog } from "@/helpers/debug-log-helper";
|
import { debugLog } from "@/helpers/debug-log-helper";
|
||||||
|
|
||||||
//define validation rules
|
//define validation rules
|
||||||
|
|
@ -252,17 +253,17 @@ export default {
|
||||||
const matchingMake = resultMap.makeQuestionInitialData?.filter(
|
const matchingMake = resultMap.makeQuestionInitialData?.filter(
|
||||||
(item) =>
|
(item) =>
|
||||||
item.toLowerCase() ===
|
item.toLowerCase() ===
|
||||||
store.getters.externalParameterVehicle.make.toLowerCase()
|
store.getters.externalParameterVehicle.make?.toLowerCase()
|
||||||
);
|
);
|
||||||
const matchingModel = resultMap.modelQuestionInitialData?.filter(
|
const matchingModel = resultMap.modelQuestionInitialData?.filter(
|
||||||
(item) =>
|
(item) =>
|
||||||
item.toLowerCase() ===
|
item.toLowerCase() ===
|
||||||
store.getters.externalParameterVehicle.model.toLowerCase()
|
store.getters.externalParameterVehicle.model?.toLowerCase()
|
||||||
);
|
);
|
||||||
const matchingStyle = resultMap.styleQuestionInitialData?.filter(
|
const matchingStyle = resultMap.styleQuestionInitialData?.filter(
|
||||||
(item) =>
|
(item) =>
|
||||||
item.toLowerCase() ===
|
item.toLowerCase() ===
|
||||||
store.getters.externalParameterVehicle.style.toLowerCase()
|
store.getters.externalParameterVehicle.style?.toLowerCase()
|
||||||
);
|
);
|
||||||
baseMixin.methods.dispatchStoreAction(
|
baseMixin.methods.dispatchStoreAction(
|
||||||
storeActions.UPDATE_EXTERNAL_PARAMETER_MMS,
|
storeActions.UPDATE_EXTERNAL_PARAMETER_MMS,
|
||||||
|
|
@ -291,7 +292,12 @@ export default {
|
||||||
resultMap.modelQuestionInitialData,
|
resultMap.modelQuestionInitialData,
|
||||||
resultMap.styleQuestionInitialData
|
resultMap.styleQuestionInitialData
|
||||||
);
|
);
|
||||||
if (store.getters.externalParameterState?.isExternalParameter) {
|
if (
|
||||||
|
store.getters.externalParameterState?.isExternalParameter &&
|
||||||
|
store.getters.externalParameterVehicle.year &&
|
||||||
|
store.getters.externalParameterVehicle.make &&
|
||||||
|
store.getters.externalParameterVehicle.model
|
||||||
|
) {
|
||||||
await vm.getVehicleDetails();
|
await vm.getVehicleDetails();
|
||||||
if (!vm.displayNoServiceAlert) {
|
if (!vm.displayNoServiceAlert) {
|
||||||
const isValid = await baseMixin.methods.isFormValid(vm.$refs.theForm);
|
const isValid = await baseMixin.methods.isFormValid(vm.$refs.theForm);
|
||||||
|
|
@ -304,7 +310,7 @@ export default {
|
||||||
baseMixin.methods.ResetExternalParamsAndHideModal();
|
baseMixin.methods.ResetExternalParamsAndHideModal();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
baseMixin.methods.ResetExternalParamsAndHideModal();
|
showFmgLoadingModal(false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -132,51 +132,6 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
async logDigitalConsumer() {
|
|
||||||
const currentPageName = getPageNameFromRouter();
|
|
||||||
const universes = store.getters.applicationUser.experiments;
|
|
||||||
|
|
||||||
const variationNames = universes
|
|
||||||
.filter((item) => item.universeName === experimentUniverses.CONCEPT_FUNNEL)
|
|
||||||
.map((item) => item.variationName)
|
|
||||||
.filter(Boolean); // removes undefined/null
|
|
||||||
|
|
||||||
const conceptVariation = variationNames.length > 0 ? variationNames[0] : "";
|
|
||||||
|
|
||||||
const isConceptExposed = universes.find(
|
|
||||||
(item) => item.universeName === experimentUniverses.CONCEPT_FUNNEL
|
|
||||||
)?.isExposed;
|
|
||||||
|
|
||||||
const submittedOrder = baseMixin.methods.getSubmittedOrder();
|
|
||||||
const hasSubmittedOrder = baseMixin.methods.hasSubmittedOrder();
|
|
||||||
const hasSubmittedOrderAtConfirmationPage =
|
|
||||||
hasSubmittedOrder && currentPageName?.toLowerCase() == routeData.CONFIRMATION.name;
|
|
||||||
|
|
||||||
var payload = {
|
|
||||||
actionName: `Browser page:${currentPageName}`,
|
|
||||||
referralSequenceNumber: hasSubmittedOrderAtConfirmationPage
|
|
||||||
? submittedOrder.referralSequenceNumber
|
|
||||||
: store.getters.order.referralSequenceNumber,
|
|
||||||
referralNumber: hasSubmittedOrderAtConfirmationPage
|
|
||||||
? submittedOrder.referralNumber
|
|
||||||
: store.getters.order.referralNumber,
|
|
||||||
workOrderId: hasSubmittedOrderAtConfirmationPage
|
|
||||||
? submittedOrder.workOrderId
|
|
||||||
: store.getters.order.workOrderId,
|
|
||||||
workOrderNumber: hasSubmittedOrderAtConfirmationPage
|
|
||||||
? submittedOrder.workOrderNumber
|
|
||||||
: store.getters.order.workOrderNumber,
|
|
||||||
conceptVariation: conceptVariation,
|
|
||||||
isConceptExposed: isConceptExposed,
|
|
||||||
};
|
|
||||||
|
|
||||||
await baseMixin.methods.dispatchStoreAction(
|
|
||||||
storeActions.LOG_DIGITALCONSUMER,
|
|
||||||
payload,
|
|
||||||
false
|
|
||||||
);
|
|
||||||
},
|
|
||||||
|
|
||||||
async pushEventForChatsToGA(category, action, label, pushToLogApp = false) {
|
async pushEventForChatsToGA(category, action, label, pushToLogApp = false) {
|
||||||
const currentPageName = getPageNameFromRouter();
|
const currentPageName = getPageNameFromRouter();
|
||||||
const value = `2.0_${currentPageName}`;
|
const value = `2.0_${currentPageName}`;
|
||||||
|
|
@ -206,6 +161,11 @@ export default {
|
||||||
// S3 bucket, safelite-dev-digitalconsumer-session-data-us-east-2/1.
|
// S3 bucket, safelite-dev-digitalconsumer-session-data-us-east-2/1.
|
||||||
// This bucket data is then picked up by snowflake for analytics use.
|
// This bucket data is then picked up by snowflake for analytics use.
|
||||||
async pushFmgSessionData() {
|
async pushFmgSessionData() {
|
||||||
|
var currentPageName = getPageNameFromRouter(true);
|
||||||
|
if (!currentPageName) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const hasSubmittedOrder = baseMixin.methods.hasSubmittedOrder();
|
const hasSubmittedOrder = baseMixin.methods.hasSubmittedOrder();
|
||||||
const submittedOrder = baseMixin.methods.getSubmittedOrder();
|
const submittedOrder = baseMixin.methods.getSubmittedOrder();
|
||||||
const order = hasSubmittedOrder ? submittedOrder : store.getters.order;
|
const order = hasSubmittedOrder ? submittedOrder : store.getters.order;
|
||||||
|
|
@ -247,22 +207,6 @@ export default {
|
||||||
}
|
}
|
||||||
|
|
||||||
var appointment = `${order?.schedule?.date ?? ""} ${order?.schedule?.startTime ?? ""}`;
|
var appointment = `${order?.schedule?.date ?? ""} ${order?.schedule?.startTime ?? ""}`;
|
||||||
var currentPageName = getPageNameFromRouter();
|
|
||||||
|
|
||||||
// add query strings to the page name for debugging. on the vehicle page, if from an external link, pull it from the stash
|
|
||||||
if (currentPageName === "vehicle") {
|
|
||||||
if (!window.location.search) {
|
|
||||||
if (store.getters.externalParameterState?.qsStash) {
|
|
||||||
currentPageName += `${store.getters.externalParameterState.qsStash}`;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
currentPageName += `${window.location.search}`;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (window.location.search) {
|
|
||||||
currentPageName += `${window.location.search}`;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var sessionData = {};
|
var sessionData = {};
|
||||||
sessionData.currentPage = currentPageName;
|
sessionData.currentPage = currentPageName;
|
||||||
|
|
@ -911,6 +855,9 @@ export default {
|
||||||
setSessionIdIfUnset(response.data.sessionId);
|
setSessionIdIfUnset(response.data.sessionId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// logging on session init so we capture complete query string data
|
||||||
|
await this.pushFmgSessionData();
|
||||||
},
|
},
|
||||||
|
|
||||||
noSession() {
|
noSession() {
|
||||||
|
|
@ -977,7 +924,7 @@ function pushToDataLayerIfDefined(data) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function getPageNameFromRouter() {
|
function getPageNameFromRouter(useDefaultUrl = false) {
|
||||||
if (
|
if (
|
||||||
router &&
|
router &&
|
||||||
router.currentRoute &&
|
router.currentRoute &&
|
||||||
|
|
@ -987,7 +934,9 @@ function getPageNameFromRouter() {
|
||||||
return router.currentRoute.value.name;
|
return router.currentRoute.value.name;
|
||||||
}
|
}
|
||||||
|
|
||||||
return window.location.href.replace(/\/$/, "").split("/").pop();
|
return useDefaultUrl
|
||||||
|
? window.location.search
|
||||||
|
: window.location.href.replace(/\/$/, "").split("/").pop();
|
||||||
}
|
}
|
||||||
|
|
||||||
function getValueToLog(value, valueToLogType) {
|
function getValueToLog(value, valueToLogType) {
|
||||||
|
|
|
||||||
|
|
@ -64,6 +64,7 @@ const navigationScenarios = {
|
||||||
CLICKED_PAY_NOW: "CLICKED_PAY_NOW",
|
CLICKED_PAY_NOW: "CLICKED_PAY_NOW",
|
||||||
CLICKED_PAY_NOW_ADYEN: "CLICKED_PAY_NOW_ADYEN",
|
CLICKED_PAY_NOW_ADYEN: "CLICKED_PAY_NOW_ADYEN",
|
||||||
CLICKED_PAY_LATER: "CLICKED_PAY_LATER",
|
CLICKED_PAY_LATER: "CLICKED_PAY_LATER",
|
||||||
|
CLICKED_SWITCH_TO_INSHOP: "CLICKED_SWITCH_TO_INSHOP",
|
||||||
PIA_ERROR: "PIA_ERROR",
|
PIA_ERROR: "PIA_ERROR",
|
||||||
PIA_CC_ERROR: "PIA_CC_ERROR",
|
PIA_CC_ERROR: "PIA_CC_ERROR",
|
||||||
PIA_APPLE_ERROR: "PIA_APPLE_ERROR",
|
PIA_APPLE_ERROR: "PIA_APPLE_ERROR",
|
||||||
|
|
|
||||||
|
|
@ -553,6 +553,10 @@ const routingTable = function () {
|
||||||
scenario: navigationScenarios.CLICKED_INSURANCE,
|
scenario: navigationScenarios.CLICKED_INSURANCE,
|
||||||
destinationPageData: routeData.INSURANCE_COMPANY,
|
destinationPageData: routeData.INSURANCE_COMPANY,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
scenario: navigationScenarios.CLICKED_SWITCH_TO_INSHOP,
|
||||||
|
destinationPageData: routeData.SCHEDULE,
|
||||||
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -5,9 +5,6 @@ import { storeMutations } from "@/constants/store-mutations";
|
||||||
export async function afterEach(to, from) {
|
export async function afterEach(to, from) {
|
||||||
store.commit(storeMutations.UPDATE_LAST_PAGE_VISITED, to.name);
|
store.commit(storeMutations.UPDATE_LAST_PAGE_VISITED, to.name);
|
||||||
|
|
||||||
// digital consumer logging
|
|
||||||
analyticsMixin.methods.logDigitalConsumer();
|
|
||||||
|
|
||||||
// digital consumer fmg session logging to snowflake
|
// digital consumer fmg session logging to snowflake
|
||||||
analyticsMixin.methods.pushFmgSessionData();
|
analyticsMixin.methods.pushFmgSessionData();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -105,6 +105,7 @@ function updateExternalParameterState() {
|
||||||
}
|
}
|
||||||
if (externalParameterZipCode) {
|
if (externalParameterZipCode) {
|
||||||
store.commit(storeMutations.UPDATE_EXTERNAL_PARAMETER_ZIP_CODE, externalParameterZipCode);
|
store.commit(storeMutations.UPDATE_EXTERNAL_PARAMETER_ZIP_CODE, externalParameterZipCode);
|
||||||
|
store.commit(storeMutations.UPDATE_IS_EXTERNAL_PARAMETER, externalParameterStatus.ACTIVE);
|
||||||
}
|
}
|
||||||
if (externalParameterEmail) {
|
if (externalParameterEmail) {
|
||||||
store.commit(
|
store.commit(
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,6 @@ export async function errorBeforeEnter(to, from) {
|
||||||
nextPage: to?.name,
|
nextPage: to?.name,
|
||||||
};
|
};
|
||||||
|
|
||||||
analyticsMixin.methods.logDigitalConsumer();
|
|
||||||
await handleHardError(errorPayload);
|
await handleHardError(errorPayload);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -33,7 +32,6 @@ export async function errorBeforeEnter(to, from) {
|
||||||
nextPage: to?.name,
|
nextPage: to?.name,
|
||||||
};
|
};
|
||||||
|
|
||||||
analyticsMixin.methods.logDigitalConsumer();
|
|
||||||
await handleHardError(errorPayload);
|
await handleHardError(errorPayload);
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -192,6 +192,7 @@ const getDefaultState = () => {
|
||||||
isRecalAckOptIn: false,
|
isRecalAckOptIn: false,
|
||||||
isRecalAcknowledgedForScheduling: "",
|
isRecalAcknowledgedForScheduling: "",
|
||||||
isMSRFeeApplicable: false,
|
isMSRFeeApplicable: false,
|
||||||
|
isMSRFeeCoveredByInsurance: false,
|
||||||
},
|
},
|
||||||
applicationUser: {
|
applicationUser: {
|
||||||
eventBus: [],
|
eventBus: [],
|
||||||
|
|
@ -359,6 +360,9 @@ export const mutations = {
|
||||||
updateIsMSRFeeApplicable(state, isMSRFeeApplicable) {
|
updateIsMSRFeeApplicable(state, isMSRFeeApplicable) {
|
||||||
state.order.isMSRFeeApplicable = isMSRFeeApplicable;
|
state.order.isMSRFeeApplicable = isMSRFeeApplicable;
|
||||||
},
|
},
|
||||||
|
updateIsMSRFeeCoveredByInsurance(state, isMSRFeeCoveredByInsurance) {
|
||||||
|
state.order.isMSRFeeCoveredByInsurance = isMSRFeeCoveredByInsurance;
|
||||||
|
},
|
||||||
updateCashPriceSubTotal(state, cashPriceSubTotal) {
|
updateCashPriceSubTotal(state, cashPriceSubTotal) {
|
||||||
state.order.cashPriceSubTotal =
|
state.order.cashPriceSubTotal =
|
||||||
cashPriceSubTotal === "" ? null : cashPriceSubTotal.toString();
|
cashPriceSubTotal === "" ? null : cashPriceSubTotal.toString();
|
||||||
|
|
@ -1630,38 +1634,6 @@ export const actions = {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
logDigitalConsumer(
|
|
||||||
context,
|
|
||||||
{
|
|
||||||
actionName,
|
|
||||||
referralSequenceNumber,
|
|
||||||
referralNumber,
|
|
||||||
workOrderId,
|
|
||||||
workOrderNumber,
|
|
||||||
conceptVariation,
|
|
||||||
isConceptExposed,
|
|
||||||
}
|
|
||||||
) {
|
|
||||||
var payload = {
|
|
||||||
sessionId: getSessionIdValue(),
|
|
||||||
deviceId: getDeviceIdValue(),
|
|
||||||
actionName: actionName ?? "",
|
|
||||||
referralSequenceNumber: referralSequenceNumber ?? "",
|
|
||||||
referralNumber: referralNumber ?? "",
|
|
||||||
applicationName: baseMixin.methods.isMobileDevice() ? "2.0 Mobile" : "2.0",
|
|
||||||
workOrderId: workOrderId ?? "",
|
|
||||||
workOrderNumber: workOrderNumber ?? "",
|
|
||||||
conceptVariation: conceptVariation,
|
|
||||||
isConceptExposed: isConceptExposed,
|
|
||||||
};
|
|
||||||
|
|
||||||
return globalMethods.callHttpClient({
|
|
||||||
method: endpoints.LogDigitalConsumer.method,
|
|
||||||
endpoint: endpoints.LogDigitalConsumer.url,
|
|
||||||
payload: payload,
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
logFmgSessionData(
|
logFmgSessionData(
|
||||||
context,
|
context,
|
||||||
{
|
{
|
||||||
|
|
@ -1770,6 +1742,7 @@ export const actions = {
|
||||||
method: endpoints.LogFmgSessionData.method,
|
method: endpoints.LogFmgSessionData.method,
|
||||||
endpoint: endpoints.LogFmgSessionData.url,
|
endpoint: endpoints.LogFmgSessionData.url,
|
||||||
payload: payload,
|
payload: payload,
|
||||||
|
logApiCall: false,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -2077,52 +2050,27 @@ export const actions = {
|
||||||
},
|
},
|
||||||
|
|
||||||
getServiceabilityDetails(context, { payload: { serviceZipCode }, pageNameToLog }) {
|
getServiceabilityDetails(context, { payload: { serviceZipCode }, pageNameToLog }) {
|
||||||
const escapeRecalibrationType = (rt) => rt.split("&").join("%26");
|
const flattenedLineItemsWithChildParts = getFlattenedArrayOfLineItemsWithChildParts(
|
||||||
|
context.getters.order.lineItems.glassParts
|
||||||
const partialLineItemsObjects = context.getters.order.lineItems.glassParts?.map(
|
|
||||||
(lineItem) => ({
|
|
||||||
partNumber: lineItem.partNumber,
|
|
||||||
recalibrationType:
|
|
||||||
lineItem.recalibrationType && isRecalPartOrHasChildRecalPart(lineItem)
|
|
||||||
? escapeRecalibrationType(lineItem.recalibrationType)
|
|
||||||
: undefined,
|
|
||||||
})
|
|
||||||
);
|
);
|
||||||
|
|
||||||
var lineItems = null;
|
const lineItemsList = flattenedLineItemsWithChildParts
|
||||||
if (partialLineItemsObjects) {
|
.map((item) => item.partNumber)
|
||||||
lineItems = buildQueryStringParameterFromArrayOfComplexObjects(
|
.join(",");
|
||||||
partialLineItemsObjects,
|
|
||||||
"lineItems"
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
const vehicle = context.getters.vehicle;
|
const vehicle = context.getters.vehicle;
|
||||||
const carId = vehicle.carId;
|
const carId = vehicle.carId;
|
||||||
const damage = context.getters.damage;
|
const damage = context.getters.damage;
|
||||||
const glassArray = convertGlassPieceNamingForApi(damage.glassToReplace);
|
|
||||||
|
|
||||||
const glassPieces = buildQueryStringParameterFromArrayOfComplexObjects(
|
|
||||||
glassArray,
|
|
||||||
"glassPieces"
|
|
||||||
);
|
|
||||||
|
|
||||||
const parentAccountNumber =
|
const parentAccountNumber =
|
||||||
context.getters.order.payment.parentAccountNumber ??
|
context.getters.order.payment.parentAccountNumber ??
|
||||||
applicationConfig.CASH_PARENT_ACCOUNT_NUMBER;
|
applicationConfig.CASH_PARENT_ACCOUNT_NUMBER;
|
||||||
const referralSequenceNumber = context.getters.order.referralSequenceNumber;
|
|
||||||
|
|
||||||
var endPoint = `${endpoints.GetServiceabilityDetails.url}?zip=${serviceZipCode}&carId=${carId}&parentAccountNumber=${parentAccountNumber}&referralSequenceNumber=${referralSequenceNumber}&applicationName=${applicationConfig.ANALYTICS_APPLICATION_NAME}`;
|
var endPoint = `${endpoints.GetServiceabilityDetails.url}?zip=${serviceZipCode}&carId=${carId}&parentAccountNumber=${parentAccountNumber}&isRepair=${damage.isRepair}`;
|
||||||
if (lineItems) {
|
if (lineItemsList) {
|
||||||
endPoint += `&${lineItems}`;
|
endPoint += `&lineItems=${lineItemsList}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (glassPieces) {
|
|
||||||
endPoint += `&${glassPieces}`;
|
|
||||||
}
|
|
||||||
|
|
||||||
endPoint += `&isHeavyTruckVehicle=${context.getters.order.vehicle.isBigTruck}`;
|
|
||||||
|
|
||||||
return globalMethods.callHttpClient({
|
return globalMethods.callHttpClient({
|
||||||
method: endpoints.GetServiceabilityDetails.method,
|
method: endpoints.GetServiceabilityDetails.method,
|
||||||
endpoint: endPoint,
|
endpoint: endPoint,
|
||||||
|
|
@ -2630,6 +2578,7 @@ export const actions = {
|
||||||
lockToken: order.lockToken,
|
lockToken: order.lockToken,
|
||||||
isRecalAckOptIn: order.isRecalAckOptIn,
|
isRecalAckOptIn: order.isRecalAckOptIn,
|
||||||
isMSRFeeApplicable: order.isMSRFeeApplicable,
|
isMSRFeeApplicable: order.isMSRFeeApplicable,
|
||||||
|
isMSRFeeCoveredByInsurance: order.isMSRFeeCoveredByInsurance,
|
||||||
cashPriceSubTotal: order.cashPriceSubTotal,
|
cashPriceSubTotal: order.cashPriceSubTotal,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
@ -3062,6 +3011,13 @@ export const actions = {
|
||||||
context.commit(storeMutations.UPDATE_IS_MSR_FEE_APPLICABLE, isMSRFeeApplicable);
|
context.commit(storeMutations.UPDATE_IS_MSR_FEE_APPLICABLE, isMSRFeeApplicable);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
saveIsMSRFeeCoveredByInsurance(context, isMSRFeeCoveredByInsurance) {
|
||||||
|
context.commit(
|
||||||
|
storeMutations.UPDATE_IS_MSR_FEE_COVERED_BY_INSURANCE,
|
||||||
|
isMSRFeeCoveredByInsurance
|
||||||
|
);
|
||||||
|
},
|
||||||
|
|
||||||
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