Merge pull request #1998 from Safelite/feature/CSR-2166
Feature/CSR-2166
This commit is contained in:
commit
1bcfc834f8
6 changed files with 58 additions and 61 deletions
|
|
@ -93,7 +93,6 @@ import textBlock from "@/digital-components/text-block/text-block";
|
||||||
|
|
||||||
//Supporting files
|
//Supporting files
|
||||||
import baseMixin from "@/mixins/base-mixin.js";
|
import baseMixin from "@/mixins/base-mixin.js";
|
||||||
import analyticsMixin from "@/mixins/analytics-mixin";
|
|
||||||
import store from "@/store";
|
import store from "@/store";
|
||||||
import { storeActions } from "@/constants/store-actions";
|
import { storeActions } from "@/constants/store-actions";
|
||||||
import { fetchCmsContentForPage } from "@/helpers/cms-content-helper";
|
import { fetchCmsContentForPage } from "@/helpers/cms-content-helper";
|
||||||
|
|
@ -107,7 +106,8 @@ import { get12HourTimeFormat, get12HourTimeMobileFormat } from "@/helpers/date-h
|
||||||
import { coverageStatus } from "@/constants/insurance";
|
import { coverageStatus } from "@/constants/insurance";
|
||||||
import { getDisplayTextForDurationLength } from "@/helpers/duration-length-helper";
|
import { getDisplayTextForDurationLength } from "@/helpers/duration-length-helper";
|
||||||
import { experimentSettings } from "@/constants/experiments";
|
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 {
|
export default {
|
||||||
name: "confirmation",
|
name: "confirmation",
|
||||||
|
|
@ -169,8 +169,17 @@ export default {
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
isRecalibrationOnOrder() {
|
||||||
|
return containsLineItemWithPartType(
|
||||||
|
partTypeStrings.RECALIBRATION,
|
||||||
|
this?.lineItems?.supportingItems
|
||||||
|
);
|
||||||
|
},
|
||||||
shouldHideRecalibration() {
|
shouldHideRecalibration() {
|
||||||
return this.getSettingValue(experimentSettings.RECAL_PRICE_REMOVE);
|
return (
|
||||||
|
this.getSettingValue(experimentSettings.RECAL_PRICE_REMOVE)?.toLowerCase() === "true" &&
|
||||||
|
this.isRecalibrationOnOrder
|
||||||
|
);
|
||||||
},
|
},
|
||||||
ShowCart() {
|
ShowCart() {
|
||||||
if (this.isPia && this.submittedOrder?.settledTenderAmount == 0) {
|
if (this.isPia && this.submittedOrder?.settledTenderAmount == 0) {
|
||||||
|
|
|
||||||
|
|
@ -593,7 +593,7 @@ export default {
|
||||||
},
|
},
|
||||||
shouldHideRecalibration() {
|
shouldHideRecalibration() {
|
||||||
return (
|
return (
|
||||||
this.getSettingValue(experimentSettings.RECAL_PRICE_REMOVE).toLowerCase() === "true" &&
|
this.getSettingValue(experimentSettings.RECAL_PRICE_REMOVE)?.toLowerCase() === "true" &&
|
||||||
this.isRecalibrationOnOrder
|
this.isRecalibrationOnOrder
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ import store from "@/store";
|
||||||
import * as navigateToHeritage from "@/helpers/heritage-integration/navigation-helper";
|
import * as navigateToHeritage from "@/helpers/heritage-integration/navigation-helper";
|
||||||
import { nextTick } from "vue";
|
import { nextTick } from "vue";
|
||||||
import { experimentSettings } from "@/constants/experiments";
|
import { experimentSettings } from "@/constants/experiments";
|
||||||
|
import experimentMixin from "@/mixins/experiment-mixin.js";
|
||||||
import baseMixin from "@/mixins/base-mixin.js";
|
import baseMixin from "@/mixins/base-mixin.js";
|
||||||
import { containsLineItemWithPartType } from "../../helpers/service-package-helper";
|
import { containsLineItemWithPartType } from "../../helpers/service-package-helper";
|
||||||
|
|
||||||
|
|
@ -746,6 +747,14 @@ function setupMocks({ customMountOptions }) {
|
||||||
...customMountOptions,
|
...customMountOptions,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
mountOptions.mixins = [
|
||||||
|
{
|
||||||
|
methods: {
|
||||||
|
getSettingValue: jest.fn(),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
baseMixin.methods.ResetExternalParamsAndHideModal = jest.fn();
|
baseMixin.methods.ResetExternalParamsAndHideModal = jest.fn();
|
||||||
baseMixin.methods.isFormValid = jest.fn().mockReturnValue(true);
|
baseMixin.methods.isFormValid = jest.fn().mockReturnValue(true);
|
||||||
mountOptions.global.mocks["$store"] = store;
|
mountOptions.global.mocks["$store"] = store;
|
||||||
|
|
|
||||||
|
|
@ -15,13 +15,6 @@
|
||||||
|
|
||||||
<funnelSubHeader class="mb-5" cmsWidgetName="FunnelSubHeaderWidget" />
|
<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
|
<cashOrInsuranceQuestion
|
||||||
ref="cashOrInsurance"
|
ref="cashOrInsurance"
|
||||||
cmsWidgetName="CashOrInsuranceQuestionWidget"
|
cmsWidgetName="CashOrInsuranceQuestionWidget"
|
||||||
|
|
@ -120,8 +113,7 @@ import { storeActions } from "@/constants/store-actions";
|
||||||
import { deepClone } from "@/helpers/object-helper";
|
import { deepClone } from "@/helpers/object-helper";
|
||||||
import store from "@/store";
|
import store from "@/store";
|
||||||
import { fetchCmsContentForPage } from "@/helpers/cms-content-helper";
|
import { fetchCmsContentForPage } from "@/helpers/cms-content-helper";
|
||||||
import { experimentUniverses, experimentSettings } from "@/constants/experiments";
|
import { experimentSettings } from "@/constants/experiments";
|
||||||
import { getSessionKeyValue, getUserIdValue } from "@/helpers/heritage-integration/cookie-helper";
|
|
||||||
import { required } from "@/helpers/validation-rules";
|
import { required } from "@/helpers/validation-rules";
|
||||||
import { errorMessages } from "@/constants/error-messages";
|
import { errorMessages } from "@/constants/error-messages";
|
||||||
import { Form, defineRule } from "vee-validate";
|
import { Form, defineRule } from "vee-validate";
|
||||||
|
|
@ -304,9 +296,10 @@ export default {
|
||||||
// Override if coming back from QuoteDetails. Remove override after Quote release
|
// Override if coming back from QuoteDetails. Remove override after Quote release
|
||||||
const isInsuranceOverrideValue = to.query?.isInsurance;
|
const isInsuranceOverrideValue = to.query?.isInsurance;
|
||||||
const defaultIsInsuranceSelectedValue = store.getters.order.payment.isInsurance;
|
const defaultIsInsuranceSelectedValue = store.getters.order.payment.isInsurance;
|
||||||
const hideRecalCost = experimentMixin.methods.getSettingValue(
|
const hideRecalCost =
|
||||||
experimentSettings.RECAL_PRICE_REMOVE
|
experimentMixin.methods
|
||||||
);
|
.getSettingValue(experimentSettings.RECAL_PRICE_REMOVE)
|
||||||
|
?.toLowerCase() === "true";
|
||||||
|
|
||||||
//Default to Insurance Tab if user Service zip is from certain States
|
//Default to Insurance Tab if user Service zip is from certain States
|
||||||
if (
|
if (
|
||||||
|
|
@ -320,17 +313,16 @@ export default {
|
||||||
return defaultIsInsuranceSelectedValue;
|
return defaultIsInsuranceSelectedValue;
|
||||||
} else {
|
} else {
|
||||||
if (availableLineItems) {
|
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 =
|
return (
|
||||||
(hideRecalCost === "true") ?
|
baseMixin.methods.getTierOnePackagePrice(lineItemsForCalculatingPrice) >
|
||||||
baseMixin.methods.filterOutFees(
|
insuranceThreshold
|
||||||
baseMixin.methods.filterOutRecalibration(availableLineItems) // Strip out recal before filtering out fees
|
); // compare base price vs arbitrary threshold (representing insurance price)
|
||||||
) :
|
|
||||||
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)
|
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
@ -341,15 +333,20 @@ export default {
|
||||||
experimentSettings.INSURANCE_TAB_TO_DISPLAY_THRESHOLD_INTERNAL
|
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;
|
if (internalThreshold) thresholdToUse = internalThreshold;
|
||||||
vm.isInsuranceSelected = getIsInsuranceSelectedValue(vm.availableLineItems, thresholdToUse);
|
vm.isInsuranceSelected = getIsInsuranceSelectedValue(
|
||||||
|
vm.availableLineItems,
|
||||||
|
thresholdToUse
|
||||||
|
);
|
||||||
baseMixin.methods.ResetExternalParamsAndHideModal();
|
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.isInsuranceSelected = true;
|
||||||
vm.servicePackage = store.getters.externalParameterQuote.servicePackage;
|
vm.servicePackage = store.getters.externalParameterQuote.servicePackage;
|
||||||
await nextTick();
|
await nextTick();
|
||||||
|
|
@ -361,9 +358,9 @@ export default {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// did user come from external source (LeadGen)?
|
// did user come from external source (LeadGen)?
|
||||||
let externalSource = store.getters.externalParameterSource ? store.getters.externalParameterSource : null;
|
let externalSource = store.getters.externalParameterSource
|
||||||
|
? store.getters.externalParameterSource
|
||||||
vm.externalSource = externalSource; // TEMP 9/23
|
: null;
|
||||||
|
|
||||||
// Business logic to determine what "external" source is
|
// Business logic to determine what "external" source is
|
||||||
if (externalSource?.includes("LeadGen")) {
|
if (externalSource?.includes("LeadGen")) {
|
||||||
|
|
@ -374,13 +371,13 @@ export default {
|
||||||
} else {
|
} else {
|
||||||
if (internalThreshold) thresholdToUse = internalThreshold;
|
if (internalThreshold) thresholdToUse = internalThreshold;
|
||||||
}
|
}
|
||||||
vm.isInsuranceSelected = getIsInsuranceSelectedValue(vm.availableLineItems, thresholdToUse);
|
vm.isInsuranceSelected = getIsInsuranceSelectedValue(
|
||||||
|
vm.availableLineItems,
|
||||||
|
thresholdToUse
|
||||||
|
);
|
||||||
baseMixin.methods.ResetExternalParamsAndHideModal();
|
baseMixin.methods.ResetExternalParamsAndHideModal();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
vm.thresholdToUse = thresholdToUse;
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
|
|
@ -392,9 +389,6 @@ export default {
|
||||||
servicePackage: null,
|
servicePackage: null,
|
||||||
holdParentAccountNumber: null,
|
holdParentAccountNumber: null,
|
||||||
holdBillToAccountNumber: null,
|
holdBillToAccountNumber: null,
|
||||||
|
|
||||||
thresholdToUse: null, // TEMP 9/23
|
|
||||||
externalSource: null, // TEMP 9/23
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
|
@ -408,10 +402,10 @@ export default {
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
shouldHideRecalibration() {
|
shouldHideRecalibration() {
|
||||||
const recalSettingValue = experimentMixin.methods.getSettingValue(
|
return (
|
||||||
experimentSettings.RECAL_PRICE_REMOVE
|
this.getSettingValue(experimentSettings.RECAL_PRICE_REMOVE)?.toLowerCase() === "true" &&
|
||||||
)?.toLowerCase() === "true";
|
this.isRecalibrationOnOrder
|
||||||
return recalSettingValue;
|
);
|
||||||
},
|
},
|
||||||
showAfterpayBanner() {
|
showAfterpayBanner() {
|
||||||
return (
|
return (
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,4 @@
|
||||||
<template>
|
<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
|
<buttonQuestion
|
||||||
ref="buttonQuestion"
|
ref="buttonQuestion"
|
||||||
:answers="servicePackageAnswers"
|
:answers="servicePackageAnswers"
|
||||||
|
|
@ -26,7 +15,6 @@
|
||||||
import buttonQuestion from "@/digital-components/button-question/button-question";
|
import buttonQuestion from "@/digital-components/button-question/button-question";
|
||||||
import baseMixin from "@/mixins/base-mixin.js";
|
import baseMixin from "@/mixins/base-mixin.js";
|
||||||
import { processIfStatements } from "@/helpers/cms-content-helper";
|
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 servicePackageRadio from "./service-package-radio/service-package-radio";
|
||||||
import { partTypeStrings } from "@/constants/part-type-strings";
|
import { partTypeStrings } from "@/constants/part-type-strings";
|
||||||
import { packageNames } from "@/constants/package-names";
|
import { packageNames } from "@/constants/package-names";
|
||||||
|
|
|
||||||
|
|
@ -1537,12 +1537,9 @@ export const actions = {
|
||||||
? context.getters.payment.billToAccountNumber
|
? context.getters.payment.billToAccountNumber
|
||||||
: applicationConfig.CASH_DEFAULT_BILL_TO_ACCOUNT_NUMBER;
|
: applicationConfig.CASH_DEFAULT_BILL_TO_ACCOUNT_NUMBER;
|
||||||
|
|
||||||
const covStatus = context.getters.payment?.insuranceCoverage?.coverageStatus;
|
|
||||||
const covSubStatus = context.getters.payment?.insuranceCoverage?.coverageSubStatus;
|
|
||||||
|
|
||||||
return globalMethods.callHttpClient({
|
return globalMethods.callHttpClient({
|
||||||
method: endpoints.GetMobileFeePart.method,
|
method: endpoints.GetMobileFeePart.method,
|
||||||
endpoint: `${endpoints.GetMobileFeePart.url}/${damageType}/${parentAccountNumber}/${billToAccountNumber}/${covStatus}/${covSubStatus}`,
|
endpoint: `${endpoints.GetMobileFeePart.url}/${damageType}/${parentAccountNumber}/${billToAccountNumber}`,
|
||||||
logApiCall: true,
|
logApiCall: true,
|
||||||
pageNameToLog: pageNameToLog,
|
pageNameToLog: pageNameToLog,
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue