Merge branch 'develop' into feature/CSR-2054
This commit is contained in:
commit
7b55147d0e
12 changed files with 317 additions and 37 deletions
|
|
@ -16,3 +16,5 @@ export function coverageStatusValue(intCoverageStatus) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export { coverageStatus };
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,13 @@ import cart from "@/fmg-components/cart/cart.vue";
|
||||||
import { shallowMount } from "@vue/test-utils";
|
import { shallowMount } from "@vue/test-utils";
|
||||||
import { getMountOptions } from "@/helpers/unit-test-helper.js";
|
import { getMountOptions } from "@/helpers/unit-test-helper.js";
|
||||||
|
|
||||||
|
global.$logger = {
|
||||||
|
logInformation: jest.fn(),
|
||||||
|
logWarning: jest.fn(),
|
||||||
|
logError: jest.fn(),
|
||||||
|
logCritical: jest.fn(),
|
||||||
|
};
|
||||||
|
|
||||||
describe("cart.vue", () => {
|
describe("cart.vue", () => {
|
||||||
describe("cartItem computeds", () => {
|
describe("cartItem computeds", () => {
|
||||||
test("if there are one or more front wipers on the order, a front wiper cart item should be added to the cart", () => {
|
test("if there are one or more front wipers on the order, a front wiper cart item should be added to the cart", () => {
|
||||||
|
|
|
||||||
|
|
@ -10,11 +10,28 @@
|
||||||
href="javascript:void(0)"
|
href="javascript:void(0)"
|
||||||
class="col d-flex justify-content-between py-0">
|
class="col d-flex justify-content-between py-0">
|
||||||
<span class="label">{{ amountDueText }}</span>
|
<span class="label">{{ amountDueText }}</span>
|
||||||
<span class="label amount-due">{{ getFormattedAmount("", amountDue) }}</span>
|
<span class="label amount-due">{{
|
||||||
|
showCoverageAsPending
|
||||||
|
? verifyingCoverageText
|
||||||
|
: getFormattedAmount("", amountDue)
|
||||||
|
}}</span>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="cart-panel">
|
<div class="cart-panel">
|
||||||
<div class="price-table">
|
<div class="price-table">
|
||||||
|
<!-- Deductible, if applicable -->
|
||||||
|
<div v-if="deductibleLineItem" class="deductible">
|
||||||
|
<textBlock cmsWidgetName="DeductibleTextWidget" />
|
||||||
|
<span>
|
||||||
|
{{
|
||||||
|
showCoverageAsPending
|
||||||
|
? verifyingCoverageText
|
||||||
|
: getFormattedAmount("", deductibleLineItem.subTotal)
|
||||||
|
}}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Service Type -->
|
||||||
<div class="service-type">
|
<div class="service-type">
|
||||||
<textBlock :cmsWidgetName="servicePackageTitleWidget" />
|
<textBlock :cmsWidgetName="servicePackageTitleWidget" />
|
||||||
<span>
|
<span>
|
||||||
|
|
@ -78,27 +95,46 @@
|
||||||
<span v-else-if="cartItem == recycleFeeCartItem">
|
<span v-else-if="cartItem == recycleFeeCartItem">
|
||||||
{{ recycleFeeCartItem.name }}
|
{{ recycleFeeCartItem.name }}
|
||||||
</span>
|
</span>
|
||||||
<span>{{ getFormattedAmount(cartItem.category, cartItem.subTotal) }}</span>
|
<span
|
||||||
|
v-if="
|
||||||
|
!showCoverageAsVerified ||
|
||||||
|
(showCoverageAsVerified && !cartItem.isCoveredByInsurance)
|
||||||
|
"
|
||||||
|
>{{ getFormattedAmount(cartItem.category, cartItem.subTotal) }}</span
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Sub total, sales tax, total columns -->
|
<!-- Sub total, sales tax, total columns -->
|
||||||
<div class="sub-total">
|
<div class="sub-total">
|
||||||
<span>{{ subtotalText }}</span
|
<span>{{ subtotalText }}</span>
|
||||||
><span>{{ getFormattedAmount("", subTotal) }}</span>
|
<span>{{
|
||||||
|
showCoverageAsPending
|
||||||
|
? verifyingCoverageText
|
||||||
|
: getFormattedAmount("", subTotal)
|
||||||
|
}}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="sales-tax">
|
<div class="sales-tax">
|
||||||
<span>{{ salesTaxText }}</span
|
<span>{{ salesTaxText }}</span>
|
||||||
><span>{{ getFormattedAmount("", salesTax) }}</span>
|
<span>{{ getFormattedAmount("", salesTax) }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="showAsPaid" class="amount-paid">
|
<div v-if="showAsPaid" class="amount-paid">
|
||||||
<span>{{ amountPaidText }}</span
|
<span>{{ amountPaidText }}</span
|
||||||
><span>{{ getFormattedAmount("", amountPaid) }}</span>
|
><span>{{ getFormattedAmount("", amountPaid) }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="amount-due">
|
<div class="amount-due">
|
||||||
<span>{{ amountDueText }}</span
|
<span>{{ amountDueText }}</span>
|
||||||
><span>{{ getFormattedAmount("", amountDue) }}</span>
|
<span>{{
|
||||||
|
showCoverageAsPending
|
||||||
|
? verifyingCoverageText
|
||||||
|
: getFormattedAmount("", amountDue)
|
||||||
|
}}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div
|
||||||
|
v-if="insuranceCompanyName && (showCoverageAsVerified || showCoverageAsPending)"
|
||||||
|
class="insurance-company-name caption">
|
||||||
|
{{ insuranceCompanyName }}
|
||||||
|
</div>
|
||||||
<promoModalQuestion
|
<promoModalQuestion
|
||||||
ref="promoModalQuestion"
|
ref="promoModalQuestion"
|
||||||
class="small mt-4"
|
class="small mt-4"
|
||||||
|
|
@ -141,6 +177,7 @@ import { getPromoCodeWithoutBundleIdentifier } from "@/helpers/promotions-helper
|
||||||
import { partTypeStrings } from "@/constants/part-type-strings";
|
import { partTypeStrings } from "@/constants/part-type-strings";
|
||||||
import { cartItemCategories } from "@/constants/cart-item-categories";
|
import { cartItemCategories } from "@/constants/cart-item-categories";
|
||||||
import { cartItemTypes } from "@/constants/cart-item-types";
|
import { cartItemTypes } from "@/constants/cart-item-types";
|
||||||
|
import { coverageStatus } from "@/constants/coverage-status";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "cart",
|
name: "cart",
|
||||||
|
|
@ -153,6 +190,9 @@ export default {
|
||||||
allowItemRemoval: Boolean,
|
allowItemRemoval: Boolean,
|
||||||
recyclingModalCmsWidgetName: String,
|
recyclingModalCmsWidgetName: String,
|
||||||
showAsPaid: Boolean,
|
showAsPaid: Boolean,
|
||||||
|
insuranceDeductible: Number,
|
||||||
|
insuranceCompanyName: String,
|
||||||
|
showInsuranceCoverageAs: String,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|
@ -255,6 +295,19 @@ export default {
|
||||||
this.$emit("update:modelValue", newValue);
|
this.$emit("update:modelValue", newValue);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
showCoverageAsPending() {
|
||||||
|
return this.showInsuranceCoverageAs === coverageStatus.PENDING;
|
||||||
|
},
|
||||||
|
showCoverageAsVerified() {
|
||||||
|
return this.showInsuranceCoverageAs === coverageStatus.VERIFIED;
|
||||||
|
},
|
||||||
|
currentDeductible() {
|
||||||
|
const deductible = this.insuranceDeductible;
|
||||||
|
if (!(deductible === 0 || deductible > 0)) {
|
||||||
|
global.$logger.logError("Error: currentDeductible should not be null");
|
||||||
|
}
|
||||||
|
return deductible;
|
||||||
|
},
|
||||||
screenReaderTotalAmountDueText() {
|
screenReaderTotalAmountDueText() {
|
||||||
return this.getCmsContent("ScreenReaderTotalAmountDueWidget", "Text");
|
return this.getCmsContent("ScreenReaderTotalAmountDueWidget", "Text");
|
||||||
},
|
},
|
||||||
|
|
@ -364,11 +417,13 @@ export default {
|
||||||
return tier;
|
return tier;
|
||||||
},
|
},
|
||||||
packagePrice() {
|
packagePrice() {
|
||||||
let packagePrice = this.isInsuranceSelected
|
let packagePrice = 0;
|
||||||
? 0
|
|
||||||
: baseMixin.methods.getTierOnePackagePrice(
|
if (!this.showCoverageAsVerified && !this.showCoverageAsPending) {
|
||||||
baseMixin.methods.filterOutFees(this.availableLineItems)
|
packagePrice = baseMixin.methods.getTierOnePackagePrice(
|
||||||
);
|
baseMixin.methods.filterOutFees(this.availableLineItems)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
packagePrice += this.getVapsPrice(this.packageLevel);
|
packagePrice += this.getVapsPrice(this.packageLevel);
|
||||||
|
|
||||||
|
|
@ -410,7 +465,25 @@ export default {
|
||||||
const promos = this.lineItems?.promos;
|
const promos = this.lineItems?.promos;
|
||||||
return promos?.length > 0 ? promos : [];
|
return promos?.length > 0 ? promos : [];
|
||||||
},
|
},
|
||||||
// Cart Items
|
deductibleLineItemName() {
|
||||||
|
return this.getCmsContent("DeductibleTextWidget", "Text");
|
||||||
|
},
|
||||||
|
deductibleLineItem() {
|
||||||
|
let lineItem = null;
|
||||||
|
|
||||||
|
if (this.showCoverageAsVerified || this.showCoverageAsPending) {
|
||||||
|
lineItem = {
|
||||||
|
name: this.deductibleLineItemName,
|
||||||
|
subTotal: this.currentDeductible,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
return lineItem;
|
||||||
|
},
|
||||||
|
verifyingCoverageText() {
|
||||||
|
return this.getCmsContent("VerifyingCoverageTextWidget", "Text");
|
||||||
|
},
|
||||||
|
// Cart Item Groupings
|
||||||
packageCartItems() {
|
packageCartItems() {
|
||||||
return this.getVapsCartItemsForSelectedPackage(this.packageLevel);
|
return this.getVapsCartItemsForSelectedPackage(this.packageLevel);
|
||||||
},
|
},
|
||||||
|
|
@ -426,6 +499,7 @@ export default {
|
||||||
});
|
});
|
||||||
return nonpackageCartItems;
|
return nonpackageCartItems;
|
||||||
},
|
},
|
||||||
|
// Individual Cart Items
|
||||||
frontWiperCartItemName() {
|
frontWiperCartItemName() {
|
||||||
return this.getCmsContentForVapsType(partTypeStrings.FRONT_WIPER);
|
return this.getCmsContentForVapsType(partTypeStrings.FRONT_WIPER);
|
||||||
},
|
},
|
||||||
|
|
@ -446,6 +520,7 @@ export default {
|
||||||
subTotal: 0,
|
subTotal: 0,
|
||||||
salesTax: 0,
|
salesTax: 0,
|
||||||
lineItems: [],
|
lineItems: [],
|
||||||
|
isCoveredByInsurance: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
frontWiperLineItems.forEach((lineItem) => {
|
frontWiperLineItems.forEach((lineItem) => {
|
||||||
|
|
@ -483,6 +558,7 @@ export default {
|
||||||
subTotal: 0,
|
subTotal: 0,
|
||||||
salesTax: 0,
|
salesTax: 0,
|
||||||
lineItems: [],
|
lineItems: [],
|
||||||
|
isCoveredByInsurance: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
rearWiperLineItems.forEach((lineItem) => {
|
rearWiperLineItems.forEach((lineItem) => {
|
||||||
|
|
@ -520,6 +596,7 @@ export default {
|
||||||
subTotal: 0,
|
subTotal: 0,
|
||||||
salesTax: 0,
|
salesTax: 0,
|
||||||
lineItems: [],
|
lineItems: [],
|
||||||
|
isCoveredByInsurance: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
rainDefenseLineItem.cartItemType = cartItem.cartItemType;
|
rainDefenseLineItem.cartItemType = cartItem.cartItemType;
|
||||||
|
|
@ -553,6 +630,7 @@ export default {
|
||||||
|
|
||||||
salesTax: lineItem.salesTax ?? 0,
|
salesTax: lineItem.salesTax ?? 0,
|
||||||
lineItems: [],
|
lineItems: [],
|
||||||
|
isCoveredByInsurance: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (lineItem.childParts?.length > 0) {
|
if (lineItem.childParts?.length > 0) {
|
||||||
|
|
@ -592,6 +670,7 @@ export default {
|
||||||
subTotal: 0,
|
subTotal: 0,
|
||||||
salesTax: 0,
|
salesTax: 0,
|
||||||
lineItems: [],
|
lineItems: [],
|
||||||
|
isCoveredByInsurance: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
recycleFeeLineItem.cartItemType = cartItem.cartItemType;
|
recycleFeeLineItem.cartItemType = cartItem.cartItemType;
|
||||||
|
|
@ -629,6 +708,7 @@ export default {
|
||||||
subTotal: 0,
|
subTotal: 0,
|
||||||
salesTax: 0,
|
salesTax: 0,
|
||||||
lineItems: [],
|
lineItems: [],
|
||||||
|
isCoveredByInsurance: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
suppliesRepairLineItem.cartItemType = cartItem.cartItemType;
|
suppliesRepairLineItem.cartItemType = cartItem.cartItemType;
|
||||||
|
|
@ -664,6 +744,7 @@ export default {
|
||||||
subTotal: 0,
|
subTotal: 0,
|
||||||
salesTax: 0,
|
salesTax: 0,
|
||||||
lineItems: [],
|
lineItems: [],
|
||||||
|
isCoveredByInsurance: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
mobileFeeLineItem.cartItemType = cartItem.cartItemType;
|
mobileFeeLineItem.cartItemType = cartItem.cartItemType;
|
||||||
|
|
@ -697,6 +778,7 @@ export default {
|
||||||
subTotal: 0,
|
subTotal: 0,
|
||||||
salesTax: 0,
|
salesTax: 0,
|
||||||
lineItems: [],
|
lineItems: [],
|
||||||
|
isCoveredByInsurance: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
otherSupportingItemsLineItems.forEach((lineItem) => {
|
otherSupportingItemsLineItems.forEach((lineItem) => {
|
||||||
|
|
@ -715,7 +797,7 @@ export default {
|
||||||
return cartItem;
|
return cartItem;
|
||||||
},
|
},
|
||||||
premiumAppointmentDiscountCartItemName() {
|
premiumAppointmentDiscountCartItemName() {
|
||||||
return "Early bird appointment"; // TODO: get from CMS
|
return this.getCmsContent("PremiumAppointmentTextWidget", "Text");
|
||||||
},
|
},
|
||||||
premiumAppointmentDiscountCartItem() {
|
premiumAppointmentDiscountCartItem() {
|
||||||
let cartItem = null;
|
let cartItem = null;
|
||||||
|
|
@ -734,6 +816,7 @@ export default {
|
||||||
subTotal: 0,
|
subTotal: 0,
|
||||||
salesTax: 0,
|
salesTax: 0,
|
||||||
lineItems: [],
|
lineItems: [],
|
||||||
|
isCoveredByInsurance: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
premiumAppointmentDiscountLineItem.cartItemType = cartItem.cartItemType;
|
premiumAppointmentDiscountLineItem.cartItemType = cartItem.cartItemType;
|
||||||
|
|
@ -779,6 +862,7 @@ export default {
|
||||||
subTotal: 0,
|
subTotal: 0,
|
||||||
salesTax: 0,
|
salesTax: 0,
|
||||||
lineItems: [],
|
lineItems: [],
|
||||||
|
isCoveredByInsurance: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
promoLineItems.forEach((promoLineItem) => {
|
promoLineItems.forEach((promoLineItem) => {
|
||||||
|
|
@ -820,17 +904,38 @@ export default {
|
||||||
subTotal() {
|
subTotal() {
|
||||||
let subTotal = 0;
|
let subTotal = 0;
|
||||||
|
|
||||||
this.cartItems.forEach((cartItem) => {
|
if (this.showCoverageAsVerified || this.showCoverageAsPending) {
|
||||||
subTotal += cartItem.subTotal;
|
// only include items NOT covered by insurance
|
||||||
});
|
this.cartItems.forEach((cartItem) => {
|
||||||
|
if (!cartItem.isCoveredByInsurance) {
|
||||||
|
subTotal += cartItem.subTotal ?? 0;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// add deductible amount still to pay
|
||||||
|
subTotal += this.deductibleLineItem.subTotal ?? 0;
|
||||||
|
} else {
|
||||||
|
this.cartItems.forEach((cartItem) => {
|
||||||
|
subTotal += cartItem.subTotal ?? 0;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
return subTotal;
|
return subTotal;
|
||||||
},
|
},
|
||||||
salesTax() {
|
salesTax() {
|
||||||
let salesTax = 0;
|
let salesTax = 0;
|
||||||
this.cartItems.forEach((cartItem) => {
|
|
||||||
salesTax += cartItem.salesTax ?? 0;
|
if (this.showCoverageAsVerified || this.showCoverageAsPending) {
|
||||||
});
|
// only include items NOT covered by insurance
|
||||||
|
this.cartItems.forEach((cartItem) => {
|
||||||
|
if (!cartItem.isCoveredByInsurance) {
|
||||||
|
salesTax += cartItem.salesTax ?? 0;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.cartItems.forEach((cartItem) => {
|
||||||
|
salesTax += cartItem.salesTax ?? 0;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
return salesTax;
|
return salesTax;
|
||||||
},
|
},
|
||||||
|
|
@ -893,7 +998,7 @@ export default {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
padding: 0.5rem 1.5rem;
|
padding: 0.5rem 1.5rem;
|
||||||
&:nth-last-child(-n + 4) {
|
&:nth-last-child(-n + 3) {
|
||||||
background-color: $green-100;
|
background-color: $green-100;
|
||||||
}
|
}
|
||||||
&:last-child {
|
&:last-child {
|
||||||
|
|
@ -901,16 +1006,26 @@ export default {
|
||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.deductible {
|
||||||
|
background-color: $gray-100;
|
||||||
|
}
|
||||||
.service-type {
|
.service-type {
|
||||||
background-color: $gray-100;
|
background-color: $gray-100;
|
||||||
align-items: center;
|
}
|
||||||
|
.deductible ~ .service-type {
|
||||||
|
background: $white;
|
||||||
|
}
|
||||||
|
.service-type ~ .packaged-cart-item {
|
||||||
|
background-color: $gray-100;
|
||||||
|
}
|
||||||
|
.deductible ~ .packaged-cart-item {
|
||||||
|
background: $white;
|
||||||
}
|
}
|
||||||
.struck-out-price {
|
.struck-out-price {
|
||||||
text-decoration: line-through;
|
text-decoration: line-through;
|
||||||
padding-left: 0.5rem;
|
padding-left: 0.5rem;
|
||||||
}
|
}
|
||||||
.packaged-cart-item {
|
.packaged-cart-item {
|
||||||
background-color: $gray-100;
|
|
||||||
padding-left: 2.5rem;
|
padding-left: 2.5rem;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
span {
|
span {
|
||||||
|
|
@ -937,6 +1052,11 @@ export default {
|
||||||
background: $gray-100;
|
background: $gray-100;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.deductible ~ .non-packaged-cart-item {
|
||||||
|
&.odd {
|
||||||
|
background: $white;
|
||||||
|
}
|
||||||
|
}
|
||||||
.non-packaged-cart-item {
|
.non-packaged-cart-item {
|
||||||
&.even {
|
&.even {
|
||||||
background-color: $white;
|
background-color: $white;
|
||||||
|
|
@ -945,6 +1065,11 @@ export default {
|
||||||
line-height: 1.625;
|
line-height: 1.625;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.deductible ~ .non-packaged-cart-item {
|
||||||
|
&.even {
|
||||||
|
background-color: $gray-100;
|
||||||
|
}
|
||||||
|
}
|
||||||
// Custom order/wrap for removable nonpackaged Cart Items
|
// Custom order/wrap for removable nonpackaged Cart Items
|
||||||
.removable-cart-item {
|
.removable-cart-item {
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
|
|
@ -959,8 +1084,8 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.package-type,
|
.package-type,
|
||||||
.service-type {
|
.service-type,
|
||||||
//background-color: #f5f5f5;
|
.deductible {
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
.sub-total,
|
.sub-total,
|
||||||
|
|
@ -973,15 +1098,19 @@ export default {
|
||||||
.sub-total {
|
.sub-total {
|
||||||
border-top: 1px solid $green;
|
border-top: 1px solid $green;
|
||||||
}
|
}
|
||||||
.service-type {
|
.service-type,
|
||||||
// background-color: #f5f5f5;
|
.deductible {
|
||||||
.text-block {
|
.text-block {
|
||||||
background: transparent;
|
background: transparent;
|
||||||
margin-top: 0;
|
margin-top: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
width: 50%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.insurance-company-name {
|
||||||
|
margin-top: 0.5rem;
|
||||||
|
}
|
||||||
.vin-toggle {
|
.vin-toggle {
|
||||||
&:after {
|
&:after {
|
||||||
content: "";
|
content: "";
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,7 @@ export default {
|
||||||
return this.leftAlignHeader ? "justify-content-start" : "justify-content-center";
|
return this.leftAlignHeader ? "justify-content-start" : "justify-content-center";
|
||||||
},
|
},
|
||||||
subText() {
|
subText() {
|
||||||
return this.getCmsContent(this.cmsWidgetName, "HeaderSubText");
|
return this.getCmsContent(this.cmsWidgetName, "SubheaderText");
|
||||||
},
|
},
|
||||||
backButtonAccessibleText() {
|
backButtonAccessibleText() {
|
||||||
return this.getCmsContent(this.cmsWidgetName, "BackButtonAccessibleText");
|
return this.getCmsContent(this.cmsWidgetName, "BackButtonAccessibleText");
|
||||||
|
|
|
||||||
|
|
@ -58,6 +58,15 @@ beforeEach(() => {
|
||||||
},
|
},
|
||||||
payment: {
|
payment: {
|
||||||
isPia: true,
|
isPia: true,
|
||||||
|
isInsurance: false,
|
||||||
|
insuranceCoverage: {
|
||||||
|
coverageStatus: "test",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
policy: {
|
||||||
|
isNoComp: false,
|
||||||
|
currentDeductible: 1,
|
||||||
|
insuranceCompanyName: "test name",
|
||||||
},
|
},
|
||||||
referralNumber: "1234567",
|
referralNumber: "1234567",
|
||||||
vehicle: {
|
vehicle: {
|
||||||
|
|
|
||||||
|
|
@ -21,10 +21,12 @@
|
||||||
:displayVehicleImage="vehicleBannerImageUrl"
|
:displayVehicleImage="vehicleBannerImageUrl"
|
||||||
:displayGenericVehicleImage="false" />
|
:displayGenericVehicleImage="false" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="scheduleText">
|
<div class="scheduleText">
|
||||||
<p>{{ ScheduleDateFormatted }}</p>
|
<p>{{ ScheduleDateFormatted }}</p>
|
||||||
<p>{{ ScheduleTimeFormatted }}</p>
|
<p>{{ ScheduleTimeFormatted }}</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<addToCalendar
|
<addToCalendar
|
||||||
mobileWidgetName="AddToCalendar_Mobile"
|
mobileWidgetName="AddToCalendar_Mobile"
|
||||||
inShopWidgetName="AddToCalendar_InShop"
|
inShopWidgetName="AddToCalendar_InShop"
|
||||||
|
|
@ -41,7 +43,9 @@
|
||||||
|
|
||||||
<div class="appoinmenttext" v-html="AppointmentWordingText"></div>
|
<div class="appoinmenttext" v-html="AppointmentWordingText"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<hr />
|
<hr />
|
||||||
|
|
||||||
<cart
|
<cart
|
||||||
v-if="ShowCart"
|
v-if="ShowCart"
|
||||||
:damage="damageInfo"
|
:damage="damageInfo"
|
||||||
|
|
@ -49,9 +53,15 @@
|
||||||
:allowItemRemoval="false"
|
:allowItemRemoval="false"
|
||||||
v-model="lineItems"
|
v-model="lineItems"
|
||||||
:showAsPaid="isPia"
|
:showAsPaid="isPia"
|
||||||
servicePackageOptionsCmsName="ServicePackageTitle" />
|
servicePackageOptionsCmsName="ServicePackageTitle"
|
||||||
|
:insuranceDeductible="currentDeductible"
|
||||||
|
:insuranceCompanyName="insuranceCompanyName"
|
||||||
|
:showInsuranceCoverageAs="showInsuranceCoverageAs" />
|
||||||
|
|
||||||
<hr class="mb-5" />
|
<hr class="mb-5" />
|
||||||
|
|
||||||
<div class="emailtext" v-html="ConfirmationEmailText"></div>
|
<div class="emailtext" v-html="ConfirmationEmailText"></div>
|
||||||
|
|
||||||
<navbar
|
<navbar
|
||||||
cmsWidgetName="FunnelFooterWidget"
|
cmsWidgetName="FunnelFooterWidget"
|
||||||
ref="navbar"
|
ref="navbar"
|
||||||
|
|
@ -86,6 +96,7 @@ import { convertDateStringToDate } from "@/layouts/schedule/helpers/schedule-hel
|
||||||
import { deepClone } from "@/helpers/object-helper";
|
import { deepClone } from "@/helpers/object-helper";
|
||||||
import { Form } from "vee-validate";
|
import { Form } from "vee-validate";
|
||||||
import { get12HourTimeFormat, get12HourTimeMobileFormat } from "@/helpers/date-helper";
|
import { get12HourTimeFormat, get12HourTimeMobileFormat } from "@/helpers/date-helper";
|
||||||
|
import { coverageStatus } from "@/constants/coverage-status";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "confirmation",
|
name: "confirmation",
|
||||||
|
|
@ -272,6 +283,32 @@ export default {
|
||||||
damageInfo() {
|
damageInfo() {
|
||||||
return store.getters.submittedOrder.damage;
|
return store.getters.submittedOrder.damage;
|
||||||
},
|
},
|
||||||
|
isInsurance() {
|
||||||
|
return store.getters.submittedOrder.payment.isInsurance;
|
||||||
|
},
|
||||||
|
isNoComp() {
|
||||||
|
return store.getters.submittedOrder.policy.isNoComp;
|
||||||
|
},
|
||||||
|
hasVapsInCart() {
|
||||||
|
if (this.lineItems?.vaps?.length > 0) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
showInsuranceCoverageAs() {
|
||||||
|
if (!this.isInsurance) return null;
|
||||||
|
if (this.isNoComp) {
|
||||||
|
return coverageStatus.NOCOMP;
|
||||||
|
} else {
|
||||||
|
return store.getters.submittedOrder.payment.insuranceCoverage.coverageStatus;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
currentDeductible() {
|
||||||
|
return store.getters.submittedOrder.policy.currentDeductible;
|
||||||
|
},
|
||||||
|
insuranceCompanyName() {
|
||||||
|
return store.getters.submittedOrder.policy.insuranceCompanyName;
|
||||||
|
},
|
||||||
isPia() {
|
isPia() {
|
||||||
return store.getters.submittedOrder?.payment.isPia;
|
return store.getters.submittedOrder?.payment.isPia;
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -53,6 +53,12 @@ function setupMocks() {
|
||||||
isPia: false,
|
isPia: false,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
policy: {
|
||||||
|
currentDeductible: 123,
|
||||||
|
},
|
||||||
|
payment: {
|
||||||
|
isInsurance: false,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
const mountOptions = getMountOptions({
|
const mountOptions = getMountOptions({
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,10 @@
|
||||||
v-model="lineItems"
|
v-model="lineItems"
|
||||||
pageName="payment-method"
|
pageName="payment-method"
|
||||||
servicePackageOptionsCmsName="ServicePackageTitle"
|
servicePackageOptionsCmsName="ServicePackageTitle"
|
||||||
recyclingModalCmsWidgetName="RecycleModal" />
|
recyclingModalCmsWidgetName="RecycleModal"
|
||||||
|
:insuranceDeductible="currentDeductible"
|
||||||
|
:insuranceCompanyName="insuranceCompanyName"
|
||||||
|
:showInsuranceCoverageAs="showInsuranceCoverageAs" />
|
||||||
|
|
||||||
<hr class="my-5" />
|
<hr class="my-5" />
|
||||||
|
|
||||||
|
|
@ -110,6 +113,7 @@ import { errorMessages } from "@/constants/error-messages";
|
||||||
import { AppointmentTypeStrings } from "@/constants/schedule-constants";
|
import { AppointmentTypeStrings } from "@/constants/schedule-constants";
|
||||||
import { partTypeStrings } from "@/constants/part-type-strings";
|
import { partTypeStrings } from "@/constants/part-type-strings";
|
||||||
import { mapTaxedLineItemsToStoreFormat } from "../../store";
|
import { mapTaxedLineItemsToStoreFormat } from "../../store";
|
||||||
|
import { coverageStatus } from "@/constants/coverage-status";
|
||||||
|
|
||||||
defineRule("option-required", required(errorMessages.OPTION_REQUIRED));
|
defineRule("option-required", required(errorMessages.OPTION_REQUIRED));
|
||||||
|
|
||||||
|
|
@ -331,7 +335,21 @@ export default {
|
||||||
(isMobile && mobileReqs) || (!isMobile && dropOffInshopReqs);
|
(isMobile && mobileReqs) || (!isMobile && dropOffInshopReqs);
|
||||||
|
|
||||||
// Insurance
|
// Insurance
|
||||||
const isInsuranceSet = store.getters.order.payment.isInsurance !== null;
|
const isInsurance = store.getters.order.payment.isInsurance;
|
||||||
|
const insuranceCoverageStatus = store.getters.payment.insuranceCoverage.coverageStatus;
|
||||||
|
const currentDeductible = store.getters.policy.currentDeductible;
|
||||||
|
const isInsuranceSet = () => {
|
||||||
|
if (isInsurance !== null) {
|
||||||
|
if (
|
||||||
|
insuranceCoverageStatus === coverageStatus.VERIFIED &&
|
||||||
|
!(currentDeductible === 0 || currentDeductible > 0)
|
||||||
|
) {
|
||||||
|
return false; // if coverageStatus is verified there must be a valid deductible also
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
|
||||||
// Schedule
|
// Schedule
|
||||||
const schedule = store.getters.order.schedule;
|
const schedule = store.getters.order.schedule;
|
||||||
|
|
@ -496,6 +514,32 @@ export default {
|
||||||
damageInfo() {
|
damageInfo() {
|
||||||
return this.$store.getters.damage;
|
return this.$store.getters.damage;
|
||||||
},
|
},
|
||||||
|
isInsurance() {
|
||||||
|
return this.$store.getters.payment.isInsurance;
|
||||||
|
},
|
||||||
|
isNoComp() {
|
||||||
|
return this.$store.getters.policy.isNoComp;
|
||||||
|
},
|
||||||
|
hasVapsInCart() {
|
||||||
|
if (this.lineItems?.vaps?.length > 0) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
showInsuranceCoverageAs() {
|
||||||
|
if (!this.isInsurance) return null;
|
||||||
|
if (this.isNoComp) {
|
||||||
|
return coverageStatus.NOCOMP;
|
||||||
|
} else {
|
||||||
|
return this.$store.getters.payment.insuranceCoverage.coverageStatus;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
currentDeductible() {
|
||||||
|
return this.$store.getters.policy.currentDeductible;
|
||||||
|
},
|
||||||
|
insuranceCompanyName() {
|
||||||
|
return this.$store.getters.policy.insuranceCompanyName;
|
||||||
|
},
|
||||||
noPiaDisclaimer() {
|
noPiaDisclaimer() {
|
||||||
return this.getCmsContent("NoPiaDisclaimerWidget", "Text");
|
return this.getCmsContent("NoPiaDisclaimerWidget", "Text");
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -202,6 +202,9 @@ describe("payment.vue", () => {
|
||||||
jobMaxMinutes: "45",
|
jobMaxMinutes: "45",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
policy: {
|
||||||
|
currentDeductible: 1,
|
||||||
|
},
|
||||||
get payment() {
|
get payment() {
|
||||||
return this.order.payment;
|
return this.order.payment;
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,10 @@
|
||||||
:allowItemRemoval="false"
|
:allowItemRemoval="false"
|
||||||
v-model="lineItems"
|
v-model="lineItems"
|
||||||
servicePackageOptionsCmsName="ServicePackageTitle"
|
servicePackageOptionsCmsName="ServicePackageTitle"
|
||||||
recyclingModalCmsWidgetName="RecycleModal" />
|
recyclingModalCmsWidgetName="RecycleModal"
|
||||||
|
:insuranceDeductible="currentDeductible"
|
||||||
|
:insuranceCompanyName="insuranceCompanyName"
|
||||||
|
:showInsuranceCoverageAs="showInsuranceCoverageAs" />
|
||||||
|
|
||||||
<hr class="mb-5" />
|
<hr class="mb-5" />
|
||||||
|
|
||||||
|
|
@ -219,9 +222,9 @@ import { queryStrings } from "@/constants/query-strings";
|
||||||
import { getQuerystringParameter } from "@/helpers/querystring-helper";
|
import { getQuerystringParameter } from "@/helpers/querystring-helper";
|
||||||
import { deepClone } from "@/helpers/object-helper";
|
import { deepClone } from "@/helpers/object-helper";
|
||||||
import { submitWorkOrder } from "@/helpers/heritage-integration/order-helper.js";
|
import { submitWorkOrder } from "@/helpers/heritage-integration/order-helper.js";
|
||||||
|
|
||||||
import iframeResize from "../../../node_modules/iframe-resizer/js/iframeResizer.js";
|
import iframeResize from "../../../node_modules/iframe-resizer/js/iframeResizer.js";
|
||||||
import { routerParams } from "@/router/router-constants/router-params";
|
import { routerParams } from "@/router/router-constants/router-params";
|
||||||
|
import { coverageStatus } from "@/constants/coverage-status";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "payment",
|
name: "payment",
|
||||||
|
|
@ -425,6 +428,32 @@ export default {
|
||||||
damageInfo() {
|
damageInfo() {
|
||||||
return this.$store.getters.damage;
|
return this.$store.getters.damage;
|
||||||
},
|
},
|
||||||
|
isInsurance() {
|
||||||
|
return this.$store.getters.payment.isInsurance;
|
||||||
|
},
|
||||||
|
isNoComp() {
|
||||||
|
return this.$store.getters.policy.isNoComp;
|
||||||
|
},
|
||||||
|
hasVapsInCart() {
|
||||||
|
if (this.lineItems?.vaps?.length > 0) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
showInsuranceCoverageAs() {
|
||||||
|
if (!this.isInsurance) return null;
|
||||||
|
if (this.isNoComp) {
|
||||||
|
return coverageStatus.NOCOMP;
|
||||||
|
} else {
|
||||||
|
return this.$store.getters.payment.insuranceCoverage.coverageStatus;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
currentDeductible() {
|
||||||
|
return this.$store.getters.policy.currentDeductible;
|
||||||
|
},
|
||||||
|
insuranceCompanyName() {
|
||||||
|
return this.$store.getters.policy.insuranceCompanyName;
|
||||||
|
},
|
||||||
isPaypal() {
|
isPaypal() {
|
||||||
if (this.paymentType == "pp") {
|
if (this.paymentType == "pp") {
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
|
|
@ -276,7 +276,8 @@ export default {
|
||||||
isDefined(order.payment.insuranceCoverage.isVerified) &&
|
isDefined(order.payment.insuranceCoverage.isVerified) &&
|
||||||
order.payment.insuranceCoverage.isVerified &&
|
order.payment.insuranceCoverage.isVerified &&
|
||||||
isDefined(order.policy.currentDeductible) &&
|
isDefined(order.policy.currentDeductible) &&
|
||||||
order.policy.currentDeductible == 0
|
order.policy.currentDeductible > 0 &&
|
||||||
|
order.policy.currentDeductible != 9999
|
||||||
) {
|
) {
|
||||||
payload.priceSubTotal = "";
|
payload.priceSubTotal = "";
|
||||||
} else if (isPricingAvailable) {
|
} else if (isPricingAvailable) {
|
||||||
|
|
@ -302,7 +303,8 @@ export default {
|
||||||
isDefined(order.payment.insuranceCoverage.isVerified) &&
|
isDefined(order.payment.insuranceCoverage.isVerified) &&
|
||||||
order.payment.insuranceCoverage.isVerified &&
|
order.payment.insuranceCoverage.isVerified &&
|
||||||
isDefined(order.policy.currentDeductible) &&
|
isDefined(order.policy.currentDeductible) &&
|
||||||
order.policy.currentDeductible == 0
|
order.policy.currentDeductible > 0 &&
|
||||||
|
order.policy.currentDeductible != 9999
|
||||||
) {
|
) {
|
||||||
payload.priceTotal = "";
|
payload.priceTotal = "";
|
||||||
} else if (isTaxAvailable) {
|
} else if (isTaxAvailable) {
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ import {
|
||||||
} from "@/helpers/promotions-helper";
|
} from "@/helpers/promotions-helper";
|
||||||
import { getDateDifferenceInDays } from "@/helpers/date-helper";
|
import { getDateDifferenceInDays } from "@/helpers/date-helper";
|
||||||
import sharedMutations from "./vuex-shared-mutations/vuexSharedMutations";
|
import sharedMutations from "./vuex-shared-mutations/vuexSharedMutations";
|
||||||
import { coverageStatusValue } from "@/constants/coverage-status";
|
import { coverageStatus, coverageStatusValue } from "@/constants/coverage-status";
|
||||||
// Export State
|
// Export State
|
||||||
const getDefaultState = () => {
|
const getDefaultState = () => {
|
||||||
return {
|
return {
|
||||||
|
|
@ -763,6 +763,18 @@ export const getters = {
|
||||||
.reduce((r, c) => Object.assign(r, c), {}) ?? {},
|
.reduce((r, c) => Object.assign(r, c), {}) ?? {},
|
||||||
submittedOrder: (state) => JSON.parse(window.sessionStorage.getItem("submittedOrder")),
|
submittedOrder: (state) => JSON.parse(window.sessionStorage.getItem("submittedOrder")),
|
||||||
hasSubmittedOrder: (state) => window.sessionStorage.getItem("submittedOrder") !== null,
|
hasSubmittedOrder: (state) => window.sessionStorage.getItem("submittedOrder") !== null,
|
||||||
|
isVerifiedAndDeductibleZeroConfirmed: (state) => {
|
||||||
|
// used as a CMS variable on /payment-method, needed for FunnelSubHeaderWidget on cart pages
|
||||||
|
if (
|
||||||
|
(state.order.policy.currentDeductible === 0 ||
|
||||||
|
state.order.policy.currentDeductible > 0) &&
|
||||||
|
state.order.payment.insuranceCoverage.coverageStatus === coverageStatus.VERIFIED &&
|
||||||
|
!state.order.policy.isNoComp
|
||||||
|
) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
function getNonFalseValuesOfPropertyInArrayOfObjects(array, propertyName) {
|
function getNonFalseValuesOfPropertyInArrayOfObjects(array, propertyName) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue