Merge pull request #3020 from Safelite/feature/CASH-2183
Feature/CASH-2183
This commit is contained in:
commit
4319541ff3
2 changed files with 45 additions and 2 deletions
|
|
@ -12,6 +12,9 @@ const experimentSettings = {
|
|||
SUPPRESS_VIN_CAPTURE: "SuppressVinCapture",
|
||||
DISPLAY_AVAILABILITY_INDICATORS: "DisplayAvailabilityIndicators",
|
||||
PIA_EXPERIENCE: "PIA Experience",
|
||||
CONDITIONAL_PROVIDER_NUMBERS: "ConditionalProviderNumbers",
|
||||
CONDITIONAL_PROVIDER_NUMBERS_2: "ConditionalProviderNumbers2",
|
||||
CONDITIONAL_PROVIDER_SHUTOFF_DATE: "ConditionalProviderShutoffDate",
|
||||
PIA_INSURANCE: "DisplayPIAInsurance",
|
||||
SUBMIT_ORDER_ENABLE_PIA: "SubmitOrder_Enable_PIA",
|
||||
IS_EMAIL_OPTIONAL: "isEmailOptional",
|
||||
|
|
|
|||
|
|
@ -810,11 +810,51 @@ export default {
|
|||
const piaInsurance = this.getSettingValue(experimentSettings.PIA_INSURANCE);
|
||||
|
||||
if (this.isInsurance) {
|
||||
return piaInsurance === "true" && this.currentDeductible > 0;
|
||||
return (
|
||||
(piaInsurance === "true" || this.isConditionalPIAEnabled) &&
|
||||
this.currentDeductible > 0
|
||||
);
|
||||
} else {
|
||||
return piaExperience === "PIA Optional" || piaExperience === "PIA Required";
|
||||
if (piaExperience?.includes("PIA Disabled")) {
|
||||
return this.isConditionalPIAEnabled;
|
||||
} else {
|
||||
return piaExperience === "PIA Optional" || piaExperience === "PIA Required";
|
||||
}
|
||||
}
|
||||
},
|
||||
isConditionalPIAEnabled() {
|
||||
const conditionalProviderNumbers = this.getSettingValue(
|
||||
experimentSettings.CONDITIONAL_PROVIDER_NUMBERS
|
||||
);
|
||||
const conditionalProviderNumbers2 = this.getSettingValue(
|
||||
experimentSettings.CONDITIONAL_PROVIDER_NUMBERS_2
|
||||
);
|
||||
const conditionalProviderShutoffDate = this.getSettingValue(
|
||||
experimentSettings.CONDITIONAL_PROVIDER_SHUTOFF_DATE
|
||||
);
|
||||
|
||||
const allConditionalProviderNumbers = [
|
||||
conditionalProviderNumbers,
|
||||
conditionalProviderNumbers2,
|
||||
]
|
||||
.filter(Boolean)
|
||||
.join(",");
|
||||
const providerNumber =
|
||||
this.$store.getters.order.serviceLocation.provider.providerNumber;
|
||||
const appointmentDate = new Date(this.$store.getters.order.schedule.date);
|
||||
const shutoffDate = new Date(conditionalProviderShutoffDate);
|
||||
if (allConditionalProviderNumbers && conditionalProviderShutoffDate) {
|
||||
const providerNumbersArray = allConditionalProviderNumbers
|
||||
.split(",")
|
||||
.map((num) => num.trim());
|
||||
if (!providerNumbersArray.includes(providerNumber)) {
|
||||
return false;
|
||||
} else {
|
||||
return appointmentDate <= shutoffDate;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
},
|
||||
paymentMethod() {
|
||||
if (!this.isPiaEnabled) {
|
||||
return paymentMethods.LATER;
|
||||
|
|
|
|||
Loading…
Reference in a new issue