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:
Alex Humphries 2026-06-10 16:47:56 -04:00
parent cc9d2d2a05
commit cf693023d7
8 changed files with 49 additions and 17 deletions

View file

@ -16,7 +16,8 @@ const experimentSettings = Object.freeze({
ISS_MOBILE_FIRST_MAX_MOBILE_DAYS: 'MaxMobileDays', ISS_MOBILE_FIRST_MAX_MOBILE_DAYS: 'MaxMobileDays',
ISS_MOBILE_FIRST_MAX_PM_MOBILE_DAYS: 'MaxPmMobileDays', ISS_MOBILE_FIRST_MAX_PM_MOBILE_DAYS: 'MaxPmMobileDays',
ISS_MOBILE_FIRST_SHOW_FIRST_MOBILE_APPOINTMENT: 'ShowMobileFirstAppointment', 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({ const experimentTest = Object.freeze({

View file

@ -146,6 +146,7 @@ import {
} from '@/helpers/cart-helper'; } from '@/helpers/cart-helper';
import { getPriceOfLineItem, getPriceOfLineItems, getTaxOfLineItems } from '@/helpers/price-calculator'; import { getPriceOfLineItem, getPriceOfLineItems, getTaxOfLineItems } from '@/helpers/price-calculator';
import { processIfStatements } from '@/helpers/cms-content-helper'; import { processIfStatements } from '@/helpers/cms-content-helper';
import partNumberStrings from '@/constants/part-number-strings';
const VERIFYING_COVERAGE = 'Verifying coverage'; const VERIFYING_COVERAGE = 'Verifying coverage';
const ADVANCED_MOBILE_MODAL_REF_NAME = 'advancedMobileModal'; const ADVANCED_MOBILE_MODAL_REF_NAME = 'advancedMobileModal';
@ -229,7 +230,8 @@ export default {
servicePrice() { servicePrice() {
const price = getPriceOfLineItems(getServiceLineItems(this.cartOrder)) ?? 0; const price = getPriceOfLineItems(getServiceLineItems(this.cartOrder)) ?? 0;
const recycleFee = this.recycleFeeLineItem ? getPriceOfLineItem(this.recycleFeeLineItem) : 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() { isUnverified() {
return isOrderUnverified(this.cartOrder); return isOrderUnverified(this.cartOrder);
@ -242,6 +244,7 @@ export default {
}, },
// TODO fix rounding // TODO fix rounding
subTotal() { subTotal() {
const subtotal = getSubtotal(this.cartOrder);
return getSubtotal(this.cartOrder); return getSubtotal(this.cartOrder);
}, },
salesTax() { salesTax() {
@ -291,7 +294,7 @@ export default {
} }
}); });
items.push(...vapsCartItems.filter((item) => item != null)); items.push(...vapsCartItems.filter((item) => item != null));
if (this.mobileFeeCartItem && !isMobileFeeHidden && !this.mobileFeeCartItem.isInsurable) { if (this.includeMobileFeeInCart) {
items.push(this.mobileFeeCartItem); items.push(this.mobileFeeCartItem);
} }
return items; return items;
@ -380,6 +383,38 @@ export default {
return { return {
feeAmount: this.mobileFeeCartItem ? formatAmountInDollars(this.mobileFeeCartItem.subTotal) : '' 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: { methods: {

View file

@ -17,12 +17,11 @@
ref="siteSubHeader" ref="siteSubHeader"
class="subheader" class="subheader"
:cmsWidgetName="widget.siteSubHeader" /> :cmsWidgetName="widget.siteSubHeader" />
<!-- TO DO: Use MSR appointment information for MSR -->
<alert <alert
ref="appointmentInformationAlert" ref="appointmentInformationAlert"
isCollapsible isCollapsible
alertClass="alert-warning" alertClass="alert-warning"
:cmsWidgetName="widget.appointmentInformation" /> :cmsWidgetName="appointmentInformationWidget" />
<checkbox <checkbox
v-if="showSameAsPolicyAddressQuestion" v-if="showSameAsPolicyAddressQuestion"
ref="sameAsPolicyAddressQuestion" ref="sameAsPolicyAddressQuestion"
@ -228,6 +227,9 @@ export default {
return acc; return acc;
}, {}); }, {});
}, },
appointmentInformationWidget() {
return this.mainStore.hasMSRPart ? this.widget.MSRAppointmentInformation : this.widget.appointmentInformation;
}
}, },
watch: { watch: {
isSameAsPolicyAddress(newValue) { isSameAsPolicyAddress(newValue) {

View file

@ -97,8 +97,6 @@
class="cart-dropdown" class="cart-dropdown"
:showAsPaid="payment.isPayInAdvance" :showAsPaid="payment.isPayInAdvance"
:readOnly="true" :readOnly="true"
recyclingModalCmsWidgetName="RecycleModal"
servicePackageTitleWidgetName="ServicePackageTitle"
:submittedOrder="submittedOrder" /> :submittedOrder="submittedOrder" />
</div> </div>
</div> </div>

View file

@ -33,8 +33,6 @@
<cartDropdown <cartDropdown
:showAsPaid="false" :showAsPaid="false"
:readOnly="false" :readOnly="false"
recyclingModalCmsWidgetName="RecycleModal"
servicePackageTitleWidgetName="ServicePackageTitle"
@switchToInShop="handleSwitchToInShop" /> @switchToInShop="handleSwitchToInShop" />
</div> </div>
<alert <alert

View file

@ -26,9 +26,7 @@
ref="cart" ref="cart"
class="cart-dropdown-component" class="cart-dropdown-component"
:readOnly="true" :readOnly="true"
:showAsPaid="false" :showAsPaid="false" />
recyclingModalCmsWidgetName="RecycleModal"
servicePackageTitleWidgetName="ServicePackageTitle" />
</div> </div>
</div> </div>
</div> </div>

View file

@ -45,9 +45,7 @@
ref="cart" ref="cart"
class="cart-dropdown-component" class="cart-dropdown-component"
:readOnly="true" :readOnly="true"
:showAsPaid="false" :showAsPaid="false" />
recyclingModalCmsWidgetName="RecycleModal"
servicePackageTitleWidgetName="ServicePackageTitle" />
</div> </div>
<div class="d-none d-lg-block"> <div class="d-none d-lg-block">
<buttonMain <buttonMain

View file

@ -453,7 +453,8 @@ export const useMainStore = defineStore({
.reduce((r, c) => Object.assign(r, c), {}) ?? {}, .reduce((r, c) => Object.assign(r, c), {}) ?? {},
originalDeductible: (state) => (state.order.damage.isRepair ? state.order.originalDeductible.repair : state.order.originalDeductible.replace), 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), 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: actions:
{ {
@ -572,7 +573,8 @@ export const useMainStore = defineStore({
policyNumber: policy.policyNumber, policyNumber: policy.policyNumber,
dateOfLoss: policy.dateOfLoss, dateOfLoss: policy.dateOfLoss,
zipCode: policy.policyZipCode, zipCode: policy.policyZipCode,
referralCorrelationId: order.referralCorrelationId referralCorrelationId: order.referralCorrelationId,
referralNumber: order.referralNumber
}, },
bailoutOnError: false bailoutOnError: false
}); });