CSR-2179: finish wrapping Remove Recal Experiment conditions around /payment-method and /confirmation
This commit is contained in:
parent
2be2a30db3
commit
3a66e4009b
2 changed files with 23 additions and 15 deletions
|
|
@ -187,6 +187,7 @@ export default {
|
||||||
insuranceDeductible: Number,
|
insuranceDeductible: Number,
|
||||||
insuranceCompanyName: String,
|
insuranceCompanyName: String,
|
||||||
showInsuranceCoverageAs: String,
|
showInsuranceCoverageAs: String,
|
||||||
|
shouldHideRecalibration: Boolean,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|
@ -438,14 +439,13 @@ export default {
|
||||||
packagePrice() {
|
packagePrice() {
|
||||||
let packagePrice = 0;
|
let packagePrice = 0;
|
||||||
|
|
||||||
if (!this.isInsurance) {
|
if (!this.isInsurance && this.shouldHideRecalibration) { // Update packagePrice if Cash only && is part of RemoveRecal experiment
|
||||||
// CASH ONLY
|
|
||||||
packagePrice = baseMixin.methods.getTierOnePackagePrice(
|
packagePrice = baseMixin.methods.getTierOnePackagePrice(
|
||||||
baseMixin.methods.filterOutFees(
|
baseMixin.methods.filterOutFees(
|
||||||
baseMixin.methods.filterOutRecalibration(this.availableLineItems)
|
baseMixin.methods.filterOutRecalibration(this.availableLineItems) // Strip out recal before filtering out fees
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
} else if (!this.showCoverageAsVerified && !this.showCoverageAsPending) {
|
} else if (!this.showCoverageAsVerified && !this.showCoverageAsPending) { // Update packagePrice if is verified insurance OR if Cash && not part of RemoveRecal experiment
|
||||||
packagePrice = baseMixin.methods.getTierOnePackagePrice(
|
packagePrice = baseMixin.methods.getTierOnePackagePrice(
|
||||||
baseMixin.methods.filterOutFees(this.availableLineItems)
|
baseMixin.methods.filterOutFees(this.availableLineItems)
|
||||||
);
|
);
|
||||||
|
|
@ -1000,22 +1000,22 @@ export default {
|
||||||
},
|
},
|
||||||
subTotal() {
|
subTotal() {
|
||||||
if (!this.lineItems || this.lineItems.length < 1) return;
|
if (!this.lineItems || this.lineItems.length < 1) return;
|
||||||
return this.isInsurance
|
return this.isInsurance || !this.shouldHideRecalibration
|
||||||
? baseMixin.methods.getSubTotal(this.lineItems)
|
? baseMixin.methods.getSubTotal(this.lineItems) // calculate with recal (if on order)
|
||||||
: baseMixin.methods.getSubTotal(this.lineItemsWithoutRecal);
|
: baseMixin.methods.getSubTotal(this.lineItemsWithoutRecal); // calculated without recal
|
||||||
},
|
},
|
||||||
salesTax() {
|
salesTax() {
|
||||||
if (!this.lineItems || this.lineItems.length < 1) return;
|
if (!this.lineItems || this.lineItems.length < 1) return;
|
||||||
return this.isInsurance
|
return this.isInsurance || !this.shouldHideRecalibration
|
||||||
? baseMixin.methods.getSalesTax(this.lineItems)
|
? baseMixin.methods.getSubTotal(this.lineItems) // calculate with recal (if on order)
|
||||||
: baseMixin.methods.getSalesTax(this.lineItemsWithoutRecal);
|
: baseMixin.methods.getSubTotal(this.lineItemsWithoutRecal); // calculated without recal
|
||||||
},
|
},
|
||||||
amountDue() {
|
amountDue() {
|
||||||
if (!this.lineItems || this.lineItems.length < 1) return;
|
if (!this.lineItems || this.lineItems.length < 1) return;
|
||||||
if (this.showAsPaid) return 0;
|
if (this.showAsPaid) return 0;
|
||||||
return this.isInsurance
|
return this.isInsurance || !this.shouldHideRecalibration
|
||||||
? baseMixin.methods.getAmountDue(this.lineItems)
|
? baseMixin.methods.getSubTotal(this.lineItems) // calculate with recal (if on order)
|
||||||
: baseMixin.methods.getAmountDue(this.lineItemsWithoutRecal);
|
: baseMixin.methods.getSubTotal(this.lineItemsWithoutRecal); // calculated without recal
|
||||||
},
|
},
|
||||||
amountPaid() {
|
amountPaid() {
|
||||||
if (!this.showAsPaid) {
|
if (!this.showAsPaid) {
|
||||||
|
|
|
||||||
|
|
@ -62,7 +62,8 @@
|
||||||
servicePackageOptionsCmsName="ServicePackageTitle"
|
servicePackageOptionsCmsName="ServicePackageTitle"
|
||||||
:insuranceDeductible="currentDeductible"
|
:insuranceDeductible="currentDeductible"
|
||||||
:insuranceCompanyName="insuranceCompanyName"
|
:insuranceCompanyName="insuranceCompanyName"
|
||||||
:showInsuranceCoverageAs="showInsuranceCoverageAs" />
|
:showInsuranceCoverageAs="showInsuranceCoverageAs"
|
||||||
|
:shouldHideRecalibration="shouldHideRecalibration" />
|
||||||
|
|
||||||
<hr class="mb-5" />
|
<hr class="mb-5" />
|
||||||
|
|
||||||
|
|
@ -105,11 +106,13 @@ import { Form } from "vee-validate";
|
||||||
import { get12HourTimeFormat, get12HourTimeMobileFormat } from "@/helpers/date-helper";
|
import { get12HourTimeFormat, get12HourTimeMobileFormat } from "@/helpers/date-helper";
|
||||||
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 experimentMixin from "@/mixins/experiment-mixin.js";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "confirmation",
|
name: "confirmation",
|
||||||
async beforeRouteEnter(to, from, next) {
|
async beforeRouteEnter(to, from, next) {
|
||||||
await baseMixin.methods.dispatchStoreAction(storeActions.CREATE_SUBMITTED_ORDER);
|
await baseMixin.methods.dispatchStoreAction(storeActions.CREATE_SUBMITTED_ORDER); // This nulls the Store order
|
||||||
|
|
||||||
// Call APIs
|
// Call APIs
|
||||||
const submittedOrder = baseMixin.methods.getSubmittedOrder();
|
const submittedOrder = baseMixin.methods.getSubmittedOrder();
|
||||||
|
|
@ -166,6 +169,11 @@ export default {
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
shouldHideRecalibration() {
|
||||||
|
return this.getSettingValue(
|
||||||
|
experimentSettings.RECAL_PRICE_REMOVE
|
||||||
|
);
|
||||||
|
},
|
||||||
ShowCart() {
|
ShowCart() {
|
||||||
if (this.isPia && this.submittedOrder?.settledTenderAmount == 0) {
|
if (this.isPia && this.submittedOrder?.settledTenderAmount == 0) {
|
||||||
// settleTenderAmount always shows 0 via localhost or dev.
|
// settleTenderAmount always shows 0 via localhost or dev.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue