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:
commit
e0155175c1
2 changed files with 18 additions and 9 deletions
|
|
@ -51,6 +51,14 @@ function setupMocks() {
|
||||||
order: {
|
order: {
|
||||||
payment: {
|
payment: {
|
||||||
isPia: false,
|
isPia: false,
|
||||||
|
insuranceCoverage: {
|
||||||
|
isVerified: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
policy: {
|
||||||
|
currentDeductible: 123,
|
||||||
|
isNoComp: false,
|
||||||
|
isItac: false,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
policy: {
|
policy: {
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,7 @@
|
||||||
<hr class="my-0" />
|
<hr class="my-0" />
|
||||||
|
|
||||||
<cart
|
<cart
|
||||||
|
ref="cart"
|
||||||
:damage="damageInfo"
|
:damage="damageInfo"
|
||||||
:availableVaps="availableVaps"
|
:availableVaps="availableVaps"
|
||||||
:allowItemRemoval="true"
|
:allowItemRemoval="true"
|
||||||
|
|
@ -46,12 +47,12 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<paymentMethodQuestion
|
<paymentMethodQuestion
|
||||||
v-if="!isPiaDisabled"
|
v-if="isPiaEnabled && totalAmountDue > 0"
|
||||||
v-model="paymentMethodInternalModel"
|
v-model="paymentMethodInternalModel"
|
||||||
validationRules="option-required" />
|
validationRules="option-required" />
|
||||||
|
|
||||||
<alert
|
<alert
|
||||||
v-if="!isPiaDisabled"
|
v-if="!isPiaEnabled && totalAmountDue > 0"
|
||||||
:isDismissible="false"
|
:isDismissible="false"
|
||||||
alertClass="alert-info"
|
alertClass="alert-info"
|
||||||
cmsWidgetName="NoPiaDisclaimerWidget"
|
cmsWidgetName="NoPiaDisclaimerWidget"
|
||||||
|
|
@ -571,21 +572,21 @@ export default {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
isPiaDisabled() {
|
totalAmountDue() {
|
||||||
|
return baseMixin.methods.getAmountDue(this.lineItems);
|
||||||
|
},
|
||||||
|
isPiaEnabled() {
|
||||||
const piaExperience = this.getSettingValue(experimentSettings.PIA_EXPERIENCE);
|
const piaExperience = this.getSettingValue(experimentSettings.PIA_EXPERIENCE);
|
||||||
const piaInsurance = this.getSettingValue(experimentSettings.PIA_INSURANCE);
|
const piaInsurance = this.getSettingValue(experimentSettings.PIA_INSURANCE);
|
||||||
|
|
||||||
var isEnabled = false;
|
|
||||||
if (this.isInsurance) {
|
if (this.isInsurance) {
|
||||||
isEnabled = piaInsurance === "true" && this.currentDeductible > 0;
|
return piaInsurance === "true" && this.currentDeductible > 0;
|
||||||
} else {
|
} else {
|
||||||
isEnabled = piaExperience === "PIA Optional" || piaExperience === "PIA Required";
|
return piaExperience === "PIA Optional" || piaExperience === "PIA Required";
|
||||||
}
|
}
|
||||||
|
|
||||||
return !isEnabled;
|
|
||||||
},
|
},
|
||||||
paymentMethod() {
|
paymentMethod() {
|
||||||
if (this.isPiaDisabled) {
|
if (!this.isPiaEnabled) {
|
||||||
return paymentMethods.LATER;
|
return paymentMethods.LATER;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue