Merge pull request #1890 from Safelite/feature/CSR-2123A

Updated logic for displaying PIA options or alert for time of service
This commit is contained in:
Leah Schumann 2024-07-02 06:28:29 -04:00 committed by GitHub
commit e0155175c1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 18 additions and 9 deletions

View file

@ -51,6 +51,14 @@ function setupMocks() {
order: {
payment: {
isPia: false,
insuranceCoverage: {
isVerified: true,
},
},
policy: {
currentDeductible: 123,
isNoComp: false,
isItac: false,
},
},
policy: {

View file

@ -22,6 +22,7 @@
<hr class="my-0" />
<cart
ref="cart"
:damage="damageInfo"
:availableVaps="availableVaps"
:allowItemRemoval="true"
@ -46,12 +47,12 @@
</div>
<paymentMethodQuestion
v-if="!isPiaDisabled"
v-if="isPiaEnabled && totalAmountDue > 0"
v-model="paymentMethodInternalModel"
validationRules="option-required" />
<alert
v-if="!isPiaDisabled"
v-if="!isPiaEnabled && totalAmountDue > 0"
:isDismissible="false"
alertClass="alert-info"
cmsWidgetName="NoPiaDisclaimerWidget"
@ -571,21 +572,21 @@ export default {
return null;
}
},
isPiaDisabled() {
totalAmountDue() {
return baseMixin.methods.getAmountDue(this.lineItems);
},
isPiaEnabled() {
const piaExperience = this.getSettingValue(experimentSettings.PIA_EXPERIENCE);
const piaInsurance = this.getSettingValue(experimentSettings.PIA_INSURANCE);
var isEnabled = false;
if (this.isInsurance) {
isEnabled = piaInsurance === "true" && this.currentDeductible > 0;
return piaInsurance === "true" && this.currentDeductible > 0;
} else {
isEnabled = piaExperience === "PIA Optional" || piaExperience === "PIA Required";
return piaExperience === "PIA Optional" || piaExperience === "PIA Required";
}
return !isEnabled;
},
paymentMethod() {
if (this.isPiaDisabled) {
if (!this.isPiaEnabled) {
return paymentMethods.LATER;
}