Merge branch 'develop' into feature/CSR-1928

This commit is contained in:
CarlNation 2024-09-24 05:52:51 -04:00
commit 3ea4c34dae
6 changed files with 58 additions and 61 deletions

View file

@ -93,7 +93,6 @@ import textBlock from "@/digital-components/text-block/text-block";
//Supporting files
import baseMixin from "@/mixins/base-mixin.js";
import analyticsMixin from "@/mixins/analytics-mixin";
import store from "@/store";
import { storeActions } from "@/constants/store-actions";
import { fetchCmsContentForPage } from "@/helpers/cms-content-helper";
@ -107,7 +106,8 @@ import { get12HourTimeFormat, get12HourTimeMobileFormat } from "@/helpers/date-h
import { coverageStatus } from "@/constants/insurance";
import { getDisplayTextForDurationLength } from "@/helpers/duration-length-helper";
import { experimentSettings } from "@/constants/experiments";
import experimentMixin from "@/mixins/experiment-mixin.js";
import { partTypeStrings } from "@/constants/part-type-strings";
import { containsLineItemWithPartType } from "@/helpers/service-package-helper";
export default {
name: "confirmation",
@ -169,8 +169,17 @@ export default {
};
},
computed: {
isRecalibrationOnOrder() {
return containsLineItemWithPartType(
partTypeStrings.RECALIBRATION,
this?.lineItems?.supportingItems
);
},
shouldHideRecalibration() {
return this.getSettingValue(experimentSettings.RECAL_PRICE_REMOVE);
return (
this.getSettingValue(experimentSettings.RECAL_PRICE_REMOVE)?.toLowerCase() === "true" &&
this.isRecalibrationOnOrder
);
},
ShowCart() {
if (this.isPia && this.submittedOrder?.settledTenderAmount == 0) {

View file

@ -593,7 +593,7 @@ export default {
},
shouldHideRecalibration() {
return (
this.getSettingValue(experimentSettings.RECAL_PRICE_REMOVE).toLowerCase() === "true" &&
this.getSettingValue(experimentSettings.RECAL_PRICE_REMOVE)?.toLowerCase() === "true" &&
this.isRecalibrationOnOrder
);
},

View file

@ -7,6 +7,7 @@ import store from "@/store";
import * as navigateToHeritage from "@/helpers/heritage-integration/navigation-helper";
import { nextTick } from "vue";
import { experimentSettings } from "@/constants/experiments";
import experimentMixin from "@/mixins/experiment-mixin.js";
import baseMixin from "@/mixins/base-mixin.js";
import { containsLineItemWithPartType } from "../../helpers/service-package-helper";
@ -746,6 +747,14 @@ function setupMocks({ customMountOptions }) {
...customMountOptions,
});
mountOptions.mixins = [
{
methods: {
getSettingValue: jest.fn(),
},
},
];
baseMixin.methods.ResetExternalParamsAndHideModal = jest.fn();
baseMixin.methods.isFormValid = jest.fn().mockReturnValue(true);
mountOptions.global.mocks["$store"] = store;

View file

@ -15,13 +15,6 @@
<funnelSubHeader class="mb-5" cmsWidgetName="FunnelSubHeaderWidget" />
<hr />
<p style="color: blue;">thresholdToUse: {{ thresholdToUse }}</p>
<p style="color: blue;">externalSource: {{ externalSource }}</p>
<p style="color: blue;">typeof recalSettingValue: {{ typeof recalSettingValue }}</p>
<p style="color: blue;">recalSettingValue: {{ recalSettingValue }}</p>
<hr />
<cashOrInsuranceQuestion
ref="cashOrInsurance"
cmsWidgetName="CashOrInsuranceQuestionWidget"
@ -120,8 +113,7 @@ import { storeActions } from "@/constants/store-actions";
import { deepClone } from "@/helpers/object-helper";
import store from "@/store";
import { fetchCmsContentForPage } from "@/helpers/cms-content-helper";
import { experimentUniverses, experimentSettings } from "@/constants/experiments";
import { getSessionKeyValue, getUserIdValue } from "@/helpers/heritage-integration/cookie-helper";
import { experimentSettings } from "@/constants/experiments";
import { required } from "@/helpers/validation-rules";
import { errorMessages } from "@/constants/error-messages";
import { Form, defineRule } from "vee-validate";
@ -304,9 +296,10 @@ export default {
// Override if coming back from QuoteDetails. Remove override after Quote release
const isInsuranceOverrideValue = to.query?.isInsurance;
const defaultIsInsuranceSelectedValue = store.getters.order.payment.isInsurance;
const hideRecalCost = experimentMixin.methods.getSettingValue(
experimentSettings.RECAL_PRICE_REMOVE
);
const hideRecalCost =
experimentMixin.methods
.getSettingValue(experimentSettings.RECAL_PRICE_REMOVE)
?.toLowerCase() === "true";
//Default to Insurance Tab if user Service zip is from certain States
if (
@ -320,17 +313,16 @@ export default {
return defaultIsInsuranceSelectedValue;
} else {
if (availableLineItems) {
const lineItemsForCalculatingPrice = hideRecalCost
? baseMixin.methods.filterOutFees(
baseMixin.methods.filterOutRecalibration(availableLineItems) // Strip out recal before filtering out fees
)
: baseMixin.methods.filterOutFees(availableLineItems);
const lineItemsForCalculatingPrice =
(hideRecalCost === "true") ?
baseMixin.methods.filterOutFees(
baseMixin.methods.filterOutRecalibration(availableLineItems) // Strip out recal before filtering out fees
) :
baseMixin.methods.filterOutFees(availableLineItems);
let tierOnePackagePriceTemp = baseMixin.methods.getTierOnePackagePrice(lineItemsForCalculatingPrice); // TEMP, FOR TESTING /// TODO AJC: TIGHTEN THIS BACK UP AFTER TESTING
return baseMixin.methods.getTierOnePackagePrice(lineItemsForCalculatingPrice) > insuranceThreshold; // compare base price vs arbitrary threshold (representing insurance price)
return (
baseMixin.methods.getTierOnePackagePrice(lineItemsForCalculatingPrice) >
insuranceThreshold
); // compare base price vs arbitrary threshold (representing insurance price)
} else {
return null;
}
@ -341,15 +333,20 @@ export default {
experimentSettings.INSURANCE_TAB_TO_DISPLAY_THRESHOLD_INTERNAL
);
if (!store.getters.externalParameterState?.isExternalParameter) { // there are no external parameters
if (!store.getters.externalParameterState?.isExternalParameter) {
// there are no external parameters
if (internalThreshold) thresholdToUse = internalThreshold;
vm.isInsuranceSelected = getIsInsuranceSelectedValue(vm.availableLineItems, thresholdToUse);
vm.isInsuranceSelected = getIsInsuranceSelectedValue(
vm.availableLineItems,
thresholdToUse
);
baseMixin.methods.ResetExternalParamsAndHideModal();
} else {
// there ARE external parameters
} else { // there ARE external parameters
if (store.getters.externalParameterQuote.isInsurance == true) { // did user intentionally select insurance?
if (store.getters.externalParameterQuote.isInsurance == true) {
// did user intentionally select insurance?
vm.isInsuranceSelected = true;
vm.servicePackage = store.getters.externalParameterQuote.servicePackage;
await nextTick();
@ -361,9 +358,9 @@ export default {
}
} else {
// did user come from external source (LeadGen)?
let externalSource = store.getters.externalParameterSource ? store.getters.externalParameterSource : null;
vm.externalSource = externalSource; // TEMP 9/23
let externalSource = store.getters.externalParameterSource
? store.getters.externalParameterSource
: null;
// Business logic to determine what "external" source is
if (externalSource?.includes("LeadGen")) {
@ -374,13 +371,13 @@ export default {
} else {
if (internalThreshold) thresholdToUse = internalThreshold;
}
vm.isInsuranceSelected = getIsInsuranceSelectedValue(vm.availableLineItems, thresholdToUse);
vm.isInsuranceSelected = getIsInsuranceSelectedValue(
vm.availableLineItems,
thresholdToUse
);
baseMixin.methods.ResetExternalParamsAndHideModal();
}
}
vm.thresholdToUse = thresholdToUse;
});
},
data() {
@ -392,9 +389,6 @@ export default {
servicePackage: null,
holdParentAccountNumber: null,
holdBillToAccountNumber: null,
thresholdToUse: null, // TEMP 9/23
externalSource: null, // TEMP 9/23
};
},
computed: {
@ -408,10 +402,10 @@ export default {
);
},
shouldHideRecalibration() {
const recalSettingValue = experimentMixin.methods.getSettingValue(
experimentSettings.RECAL_PRICE_REMOVE
)?.toLowerCase() === "true";
return recalSettingValue;
return (
this.getSettingValue(experimentSettings.RECAL_PRICE_REMOVE)?.toLowerCase() === "true" &&
this.isRecalibrationOnOrder
);
},
showAfterpayBanner() {
return (

View file

@ -1,15 +1,4 @@
<template>
<hr />
<p style="color: red;">isInsuranceSelected: {{ isInsuranceSelected }}</p>
<p style="color: red;">typeof isRecalibrationOnOrder: {{ typeof isRecalibrationOnOrder }}</p>
<p style="color: red;">isRecalibrationOnOrder: {{ isRecalibrationOnOrder }}</p>
<p style="color: red;">typeof shouldHideRecalibration: {{ typeof shouldHideRecalibration }}</p>
<p style="color: red;">shouldHideRecalibration: {{ shouldHideRecalibration }}</p>
<hr />
<buttonQuestion
ref="buttonQuestion"
:answers="servicePackageAnswers"
@ -26,7 +15,6 @@
import buttonQuestion from "@/digital-components/button-question/button-question";
import baseMixin from "@/mixins/base-mixin.js";
import { processIfStatements } from "@/helpers/cms-content-helper";
import { damageLocationsSelected as glassLocations } from "@/constants/damage-locations-selected";
import servicePackageRadio from "./service-package-radio/service-package-radio";
import { partTypeStrings } from "@/constants/part-type-strings";
import { packageNames } from "@/constants/package-names";

View file

@ -1537,12 +1537,9 @@ export const actions = {
? context.getters.payment.billToAccountNumber
: applicationConfig.CASH_DEFAULT_BILL_TO_ACCOUNT_NUMBER;
const covStatus = context.getters.payment?.insuranceCoverage?.coverageStatus;
const covSubStatus = context.getters.payment?.insuranceCoverage?.coverageSubStatus;
return globalMethods.callHttpClient({
method: endpoints.GetMobileFeePart.method,
endpoint: `${endpoints.GetMobileFeePart.url}/${damageType}/${parentAccountNumber}/${billToAccountNumber}/${covStatus}/${covSubStatus}`,
endpoint: `${endpoints.GetMobileFeePart.url}/${damageType}/${parentAccountNumber}/${billToAccountNumber}`,
logApiCall: true,
pageNameToLog: pageNameToLog,
});