INSR-9940: Improve logic for showing/hiding MSR related copy
Includes text on contact-details page and showing/hiding the relevant line item in the cart. Also includes some fixes to clear some warning related to the cart dropdown component.
This commit is contained in:
parent
cc9d2d2a05
commit
cf693023d7
8 changed files with 49 additions and 17 deletions
|
|
@ -16,7 +16,8 @@ const experimentSettings = Object.freeze({
|
|||
ISS_MOBILE_FIRST_MAX_MOBILE_DAYS: 'MaxMobileDays',
|
||||
ISS_MOBILE_FIRST_MAX_PM_MOBILE_DAYS: 'MaxPmMobileDays',
|
||||
ISS_MOBILE_FIRST_SHOW_FIRST_MOBILE_APPOINTMENT: 'ShowMobileFirstAppointment',
|
||||
ISS_ENABLE_ADYEN_V1: 'ISS_Enable_Adyen_V1'
|
||||
ISS_ENABLE_ADYEN_V1: 'ISS_Enable_Adyen_V1',
|
||||
MSR_SPLIT_PAY_ENABLED: 'EnableMSRSplitPay'
|
||||
});
|
||||
|
||||
const experimentTest = Object.freeze({
|
||||
|
|
|
|||
|
|
@ -146,6 +146,7 @@ import {
|
|||
} from '@/helpers/cart-helper';
|
||||
import { getPriceOfLineItem, getPriceOfLineItems, getTaxOfLineItems } from '@/helpers/price-calculator';
|
||||
import { processIfStatements } from '@/helpers/cms-content-helper';
|
||||
import partNumberStrings from '@/constants/part-number-strings';
|
||||
|
||||
const VERIFYING_COVERAGE = 'Verifying coverage';
|
||||
const ADVANCED_MOBILE_MODAL_REF_NAME = 'advancedMobileModal';
|
||||
|
|
@ -229,7 +230,8 @@ export default {
|
|||
servicePrice() {
|
||||
const price = getPriceOfLineItems(getServiceLineItems(this.cartOrder)) ?? 0;
|
||||
const recycleFee = this.recycleFeeLineItem ? getPriceOfLineItem(this.recycleFeeLineItem) : 0;
|
||||
return price - this.recalibrationPrice - recycleFee;
|
||||
const mobileFee = this.mobileFeeCartItem ? this.mobileFeeCartItem.subTotal : 0;
|
||||
return price - this.recalibrationPrice - recycleFee - mobileFee;
|
||||
},
|
||||
isUnverified() {
|
||||
return isOrderUnverified(this.cartOrder);
|
||||
|
|
@ -242,6 +244,7 @@ export default {
|
|||
},
|
||||
// TODO fix rounding
|
||||
subTotal() {
|
||||
const subtotal = getSubtotal(this.cartOrder);
|
||||
return getSubtotal(this.cartOrder);
|
||||
},
|
||||
salesTax() {
|
||||
|
|
@ -291,7 +294,7 @@ export default {
|
|||
}
|
||||
});
|
||||
items.push(...vapsCartItems.filter((item) => item != null));
|
||||
if (this.mobileFeeCartItem && !isMobileFeeHidden && !this.mobileFeeCartItem.isInsurable) {
|
||||
if (this.includeMobileFeeInCart) {
|
||||
items.push(this.mobileFeeCartItem);
|
||||
}
|
||||
return items;
|
||||
|
|
@ -380,6 +383,38 @@ export default {
|
|||
return {
|
||||
feeAmount: this.mobileFeeCartItem ? formatAmountInDollars(this.mobileFeeCartItem.subTotal) : ''
|
||||
}
|
||||
},
|
||||
hasMSRPart() {
|
||||
return this.cartOrder.lineItems?.feeItems?.some((item) => item.partNumber === partNumberStrings.RECAL_MOBILEDUAL || item.partNumber === partNumberStrings.RECAL_MOBILE) ?? false;
|
||||
},
|
||||
includeMobileFeeInCart() {
|
||||
if (!this.mobileFeeCartItem || this.mobileFeeCartItem.subTotal === 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const isMobileFeeHidden = this.getSettingValue(experimentSettings.ISS_FEATURE_TOGGLE_IS_MOBILE_FEE_HIDDEN) === 'true';
|
||||
if (isMobileFeeHidden) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.isITAC || this.isNoComp) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!this.hasMSRPart) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const isSplitPayEnabled = this.getSettingValue(experimentSettings.MSR_SPLIT_PAY_ENABLED) === 'true';
|
||||
if (!isSplitPayEnabled) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!this.mobileFeeCartItem.isInsurable) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
|
|
|||
|
|
@ -17,12 +17,11 @@
|
|||
ref="siteSubHeader"
|
||||
class="subheader"
|
||||
:cmsWidgetName="widget.siteSubHeader" />
|
||||
<!-- TO DO: Use MSR appointment information for MSR -->
|
||||
<alert
|
||||
ref="appointmentInformationAlert"
|
||||
isCollapsible
|
||||
alertClass="alert-warning"
|
||||
:cmsWidgetName="widget.appointmentInformation" />
|
||||
:cmsWidgetName="appointmentInformationWidget" />
|
||||
<checkbox
|
||||
v-if="showSameAsPolicyAddressQuestion"
|
||||
ref="sameAsPolicyAddressQuestion"
|
||||
|
|
@ -228,6 +227,9 @@ export default {
|
|||
return acc;
|
||||
}, {});
|
||||
},
|
||||
appointmentInformationWidget() {
|
||||
return this.mainStore.hasMSRPart ? this.widget.MSRAppointmentInformation : this.widget.appointmentInformation;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
isSameAsPolicyAddress(newValue) {
|
||||
|
|
|
|||
|
|
@ -97,8 +97,6 @@
|
|||
class="cart-dropdown"
|
||||
:showAsPaid="payment.isPayInAdvance"
|
||||
:readOnly="true"
|
||||
recyclingModalCmsWidgetName="RecycleModal"
|
||||
servicePackageTitleWidgetName="ServicePackageTitle"
|
||||
:submittedOrder="submittedOrder" />
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -33,8 +33,6 @@
|
|||
<cartDropdown
|
||||
:showAsPaid="false"
|
||||
:readOnly="false"
|
||||
recyclingModalCmsWidgetName="RecycleModal"
|
||||
servicePackageTitleWidgetName="ServicePackageTitle"
|
||||
@switchToInShop="handleSwitchToInShop" />
|
||||
</div>
|
||||
<alert
|
||||
|
|
|
|||
|
|
@ -26,9 +26,7 @@
|
|||
ref="cart"
|
||||
class="cart-dropdown-component"
|
||||
:readOnly="true"
|
||||
:showAsPaid="false"
|
||||
recyclingModalCmsWidgetName="RecycleModal"
|
||||
servicePackageTitleWidgetName="ServicePackageTitle" />
|
||||
:showAsPaid="false" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -45,9 +45,7 @@
|
|||
ref="cart"
|
||||
class="cart-dropdown-component"
|
||||
:readOnly="true"
|
||||
:showAsPaid="false"
|
||||
recyclingModalCmsWidgetName="RecycleModal"
|
||||
servicePackageTitleWidgetName="ServicePackageTitle" />
|
||||
:showAsPaid="false" />
|
||||
</div>
|
||||
<div class="d-none d-lg-block">
|
||||
<buttonMain
|
||||
|
|
|
|||
|
|
@ -453,7 +453,8 @@ export const useMainStore = defineStore({
|
|||
.reduce((r, c) => Object.assign(r, c), {}) ?? {},
|
||||
originalDeductible: (state) => (state.order.damage.isRepair ? state.order.originalDeductible.repair : state.order.originalDeductible.replace),
|
||||
currentDeductible: (state) => (state.order.damage.isRepair ? state.order.currentDeductible.repair : state.order.currentDeductible.replace),
|
||||
accountNameForEvents: (state) => state.issConfig.clientName
|
||||
accountNameForEvents: (state) => state.issConfig.clientName,
|
||||
hasMSRPart: (state) => state.order.lineItems?.feeItems?.some((item) => item.partNumber === partNumberStrings.RECAL_MOBILEDUAL || item.partNumber === partNumberStrings.RECAL_MOBILE) ?? false
|
||||
},
|
||||
actions:
|
||||
{
|
||||
|
|
@ -572,7 +573,8 @@ export const useMainStore = defineStore({
|
|||
policyNumber: policy.policyNumber,
|
||||
dateOfLoss: policy.dateOfLoss,
|
||||
zipCode: policy.policyZipCode,
|
||||
referralCorrelationId: order.referralCorrelationId
|
||||
referralCorrelationId: order.referralCorrelationId,
|
||||
referralNumber: order.referralNumber
|
||||
},
|
||||
bailoutOnError: false
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue