From 62993978fcd4e287109e902a56853641674d17fe Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Tue, 23 Apr 2024 09:19:46 -0400 Subject: [PATCH 01/43] CSR-1742: correct wrong widget name --- src/fmg-components/funnel-sub-header/funnel-sub-header.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fmg-components/funnel-sub-header/funnel-sub-header.vue b/src/fmg-components/funnel-sub-header/funnel-sub-header.vue index 20e18ba1c..b664e491c 100644 --- a/src/fmg-components/funnel-sub-header/funnel-sub-header.vue +++ b/src/fmg-components/funnel-sub-header/funnel-sub-header.vue @@ -53,7 +53,7 @@ export default { return this.leftAlignHeader ? "justify-content-start" : "justify-content-center"; }, subText() { - return this.getCmsContent(this.cmsWidgetName, "HeaderSubText"); + return this.getCmsContent(this.cmsWidgetName, "SubheaderText"); }, backButtonAccessibleText() { return this.getCmsContent(this.cmsWidgetName, "BackButtonAccessibleText"); From 35a8dc6045751394056c85a71ffae2de9bdf776f Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Tue, 23 Apr 2024 09:21:16 -0400 Subject: [PATCH 02/43] CSR-1742: add specialized getter for CMS variable use --- src/store/index.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/store/index.js b/src/store/index.js index c79269458..cac2baf7c 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -756,6 +756,18 @@ export const getters = { .reduce((r, c) => Object.assign(r, c), {}) ?? {}, submittedOrder: (state) => JSON.parse(window.sessionStorage.getItem("submittedOrder")), 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 && + state.order.policy.currentDeductible === 0 && + state.order.payment.insuranceCoverage.coverageStatus === "Verified" && + !state.order.policy.isNoComp + ) { + return true; + } + return false; + }, }; function getNonFalseValuesOfPropertyInArrayOfObjects(array, propertyName) { From 120920178c510273011493b475a36b4a4ac5de7b Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Tue, 23 Apr 2024 09:30:25 -0400 Subject: [PATCH 03/43] CSR-1742: work on cart to update for insurance orders --- src/constants/coverage-status.js | 2 + src/fmg-components/cart/cart.vue | 182 +++++++++++++++--- src/layouts/payment-method/payment-method.vue | 32 ++- 3 files changed, 191 insertions(+), 25 deletions(-) diff --git a/src/constants/coverage-status.js b/src/constants/coverage-status.js index 7cf757aed..1c75c00a6 100644 --- a/src/constants/coverage-status.js +++ b/src/constants/coverage-status.js @@ -16,3 +16,5 @@ export function coverageStatusValue(intCoverageStatus) { return null; } } + +export { coverageStatus }; diff --git a/src/fmg-components/cart/cart.vue b/src/fmg-components/cart/cart.vue index ebbaf530b..0967b37bb 100644 --- a/src/fmg-components/cart/cart.vue +++ b/src/fmg-components/cart/cart.vue @@ -10,11 +10,28 @@ href="javascript:void(0)" class="col d-flex justify-content-between py-0"> {{ amountDueText }} - {{ getFormattedAmount("", amountDue) }} + {{ + isInsuranceStatusPending + ? verifyingCoverageText + : getFormattedAmount("", amountDue) + }}
+ +
+ + + {{ + isInsuranceStatusPending + ? verifyingCoverageText + : getFormattedAmount("", deductibleLineItem.subTotal) + }} + +
+ +
@@ -78,13 +95,23 @@ {{ recycleFeeCartItem.name }} - {{ getFormattedAmount(cartItem.category, cartItem.subTotal) }} + {{ getFormattedAmount(cartItem.category, cartItem.subTotal) }}
{{ subtotalText }}{{ getFormattedAmount("", subTotal) }} + >{{ + isInsuranceStatusPending + ? verifyingCoverageText + : getFormattedAmount("", subTotal) + }}
{{ salesTaxText }}
{{ amountDueText }}{{ getFormattedAmount("", amountDue) }} + >{{ + isInsuranceStatusPending + ? verifyingCoverageText + : getFormattedAmount("", amountDue) + }}
+
+ {{ insuranceCompanyName }} +
0) + ) + return true; + return false; + }, + isInsuranceStatusVerified() { + return this.insuranceCoverageStatus === coverageStatus.VERIFIED; + }, + currentDeductible() { + if (this.insuranceCoverageStatus === coverageStatusValue(2)) + return this.currentDeductibleFromStore; + return null; + }, screenReaderTotalAmountDueText() { return this.getCmsContent("ScreenReaderTotalAmountDueWidget", "Text"); }, @@ -364,11 +419,16 @@ export default { return tier; }, packagePrice() { - let packagePrice = this.isInsuranceSelected - ? 0 - : baseMixin.methods.getTierOnePackagePrice( - baseMixin.methods.filterOutFees(this.availableLineItems) - ); + let packagePrice = 0; + + if ( + !this.isInsuranceStatusVerified || + (this.isInsuranceStatusVerified && this.isInsuranceStatusPending) + ) { + packagePrice = baseMixin.methods.getTierOnePackagePrice( + baseMixin.methods.filterOutFees(this.availableLineItems) + ); + } packagePrice += this.getVapsPrice(this.packageLevel); @@ -410,7 +470,25 @@ export default { const promos = this.lineItems?.promos; return promos?.length > 0 ? promos : []; }, - // Cart Items + deductibleLineItemName() { + return this.getCmsContent("DeductibleTextWidget", "Text"); + }, + deductibleLineItem() { + let lineItem = null; + + if (this.isInsuranceStatusVerified || this.isInsuranceStatusPending) { + lineItem = { + name: this.deductibleLineItemName, + subTotal: this.currentDeductible >= 0 ? this.currentDeductible : null, + }; + } + + return lineItem; + }, + verifyingCoverageText() { + return this.getCmsContent("VerifyingCoverageTextWidget", "Text"); + }, + // Cart Item Groupings packageCartItems() { return this.getVapsCartItemsForSelectedPackage(this.packageLevel); }, @@ -426,6 +504,7 @@ export default { }); return nonpackageCartItems; }, + // Individual Cart Items frontWiperCartItemName() { return this.getCmsContentForVapsType(partTypeStrings.FRONT_WIPER); }, @@ -446,6 +525,7 @@ export default { subTotal: 0, salesTax: 0, lineItems: [], + isCoveredByInsurance: false, }; frontWiperLineItems.forEach((lineItem) => { @@ -483,6 +563,7 @@ export default { subTotal: 0, salesTax: 0, lineItems: [], + isCoveredByInsurance: false, }; rearWiperLineItems.forEach((lineItem) => { @@ -520,6 +601,7 @@ export default { subTotal: 0, salesTax: 0, lineItems: [], + isCoveredByInsurance: false, }; rainDefenseLineItem.cartItemType = cartItem.cartItemType; @@ -553,6 +635,7 @@ export default { salesTax: lineItem.salesTax ?? 0, lineItems: [], + isCoveredByInsurance: true, }; if (lineItem.childParts?.length > 0) { @@ -592,6 +675,7 @@ export default { subTotal: 0, salesTax: 0, lineItems: [], + isCoveredByInsurance: true, }; recycleFeeLineItem.cartItemType = cartItem.cartItemType; @@ -629,6 +713,7 @@ export default { subTotal: 0, salesTax: 0, lineItems: [], + isCoveredByInsurance: true, }; suppliesRepairLineItem.cartItemType = cartItem.cartItemType; @@ -664,6 +749,7 @@ export default { subTotal: 0, salesTax: 0, lineItems: [], + isCoveredByInsurance: false, }; mobileFeeLineItem.cartItemType = cartItem.cartItemType; @@ -697,6 +783,7 @@ export default { subTotal: 0, salesTax: 0, lineItems: [], + isCoveredByInsurance: true, }; otherSupportingItemsLineItems.forEach((lineItem) => { @@ -715,7 +802,7 @@ export default { return cartItem; }, premiumAppointmentDiscountCartItemName() { - return "Early bird appointment"; // TODO: get from CMS + return this.getCmsContent("PremiumAppointmentTextWidget", "Text"); }, premiumAppointmentDiscountCartItem() { let cartItem = null; @@ -734,6 +821,7 @@ export default { subTotal: 0, salesTax: 0, lineItems: [], + isCoveredByInsurance: false, }; premiumAppointmentDiscountLineItem.cartItemType = cartItem.cartItemType; @@ -779,6 +867,7 @@ export default { subTotal: 0, salesTax: 0, lineItems: [], + isCoveredByInsurance: false, }; promoLineItems.forEach((promoLineItem) => { @@ -820,17 +909,38 @@ export default { subTotal() { let subTotal = 0; - this.cartItems.forEach((cartItem) => { - subTotal += cartItem.subTotal; - }); + if (this.isInsuranceStatusVerified) { + // 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; }, salesTax() { let salesTax = 0; - this.cartItems.forEach((cartItem) => { - salesTax += cartItem.salesTax ?? 0; - }); + + if (this.isInsuranceStatusVerified) { + // 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; }, @@ -893,7 +1003,7 @@ export default { display: flex; justify-content: space-between; padding: 0.5rem 1.5rem; - &:nth-last-child(-n + 4) { + &:nth-last-child(-n + 3) { background-color: $green-100; } &:last-child { @@ -901,16 +1011,26 @@ export default { color: #ffffff; } } + .deductible { + background-color: $gray-100; + } .service-type { 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 { text-decoration: line-through; padding-left: 0.5rem; } .packaged-cart-item { - background-color: $gray-100; padding-left: 2.5rem; align-items: center; span { @@ -937,6 +1057,11 @@ export default { background: $gray-100; } } + .deductible ~ .non-packaged-cart-item { + &.odd { + background: $white; + } + } .non-packaged-cart-item { &.even { background-color: $white; @@ -945,6 +1070,11 @@ export default { line-height: 1.625; } } + .deductible ~ .non-packaged-cart-item { + &.even { + background-color: $gray-100; + } + } // Custom order/wrap for removable nonpackaged Cart Items .removable-cart-item { flex-wrap: wrap; @@ -959,8 +1089,8 @@ export default { } } .package-type, - .service-type { - //background-color: #f5f5f5; + .service-type, + .deductible { align-items: center; } .sub-total, @@ -973,15 +1103,19 @@ export default { .sub-total { border-top: 1px solid $green; } - .service-type { - // background-color: #f5f5f5; + .service-type, + .deductible { .text-block { background: transparent; margin-top: 0; padding: 0; + width: 50%; } } } + .insurance-company-name { + margin-top: 0.5rem; + } .vin-toggle { &:after { content: ""; diff --git a/src/layouts/payment-method/payment-method.vue b/src/layouts/payment-method/payment-method.vue index 207b7f041..a97ea9a3a 100644 --- a/src/layouts/payment-method/payment-method.vue +++ b/src/layouts/payment-method/payment-method.vue @@ -28,7 +28,10 @@ v-model="lineItems" pageName="payment-method" servicePackageOptionsCmsName="ServicePackageTitle" - recyclingModalCmsWidgetName="RecycleModal" /> + recyclingModalCmsWidgetName="RecycleModal" + :currentDeductibleFromStore="currentDeductible" + :insuranceCompanyName="insuranceCompanyName" + :insuranceCoverageStatus="insuranceCoverageStatus" />
@@ -110,6 +113,7 @@ import { errorMessages } from "@/constants/error-messages"; import { AppointmentTypeStrings } from "@/constants/schedule-constants"; import { partTypeStrings } from "@/constants/part-type-strings"; import { mapTaxedLineItemsToStoreFormat } from "../../store"; +import { coverageStatus } from "@/constants/coverage-status"; defineRule("option-required", required(errorMessages.OPTION_REQUIRED)); @@ -496,6 +500,32 @@ export default { damageInfo() { 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; + }, + insuranceCoverageStatus() { + 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() { return this.getCmsContent("NoPiaDisclaimerWidget", "Text"); }, From a3d4ffb057475b5132f7d7fd121aaa7a97bed834 Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Tue, 23 Apr 2024 09:30:49 -0400 Subject: [PATCH 04/43] CSR-1742: update unit test so it will run --- src/layouts/payment-method/payment-method.spec.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/layouts/payment-method/payment-method.spec.js b/src/layouts/payment-method/payment-method.spec.js index 8cba373de..ab0a0df99 100644 --- a/src/layouts/payment-method/payment-method.spec.js +++ b/src/layouts/payment-method/payment-method.spec.js @@ -53,6 +53,12 @@ function setupMocks() { isPia: false, }, }, + policy: { + currentDeductible: 123, + }, + payment: { + isInsurance: false, + }, }; const mountOptions = getMountOptions({ From 310e77383a943d14b90ea9c453aed6a3a3698659 Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Tue, 23 Apr 2024 09:38:17 -0400 Subject: [PATCH 05/43] CSR-1742: change for consistency --- src/fmg-components/cart/cart.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/fmg-components/cart/cart.vue b/src/fmg-components/cart/cart.vue index 0967b37bb..0dad87b0d 100644 --- a/src/fmg-components/cart/cart.vue +++ b/src/fmg-components/cart/cart.vue @@ -175,7 +175,7 @@ import { getPromoCodeWithoutBundleIdentifier } from "@/helpers/promotions-helper import { partTypeStrings } from "@/constants/part-type-strings"; import { cartItemCategories } from "@/constants/cart-item-categories"; import { cartItemTypes } from "@/constants/cart-item-types"; -import { coverageStatus, coverageStatusValue } from "@/constants/coverage-status"; +import { coverageStatus } from "@/constants/coverage-status"; export default { name: "cart", @@ -306,7 +306,7 @@ export default { return this.insuranceCoverageStatus === coverageStatus.VERIFIED; }, currentDeductible() { - if (this.insuranceCoverageStatus === coverageStatusValue(2)) + if (this.insuranceCoverageStatus === coverageStatus.VERIFIED) return this.currentDeductibleFromStore; return null; }, From d3bc079eba0712aaaa99f3c8cefed21c1700052f Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Tue, 23 Apr 2024 17:38:47 -0400 Subject: [PATCH 06/43] CSR-1742: update logic on store getter for CMS variable to determine which paragraph shows in subheader --- src/store/index.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/store/index.js b/src/store/index.js index cac2baf7c..097c16689 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -29,7 +29,7 @@ import { } from "@/helpers/promotions-helper"; import { getDateDifferenceInDays } from "@/helpers/date-helper"; import sharedMutations from "./vuex-shared-mutations/vuexSharedMutations"; -import { coverageStatusValue } from "@/constants/coverage-status"; +import { coverageStatus, coverageStatusValue } from "@/constants/coverage-status"; // Export State const getDefaultState = () => { return { @@ -759,9 +759,8 @@ export const getters = { isVerifiedAndDeductibleZeroConfirmed: (state) => { // used as a CMS variable on /payment-method, needed for FunnelSubHeaderWidget on cart pages if ( - state.order.policy.currentDeductible && - state.order.policy.currentDeductible === 0 && - state.order.payment.insuranceCoverage.coverageStatus === "Verified" && + (state.order.policy.currentDeductible === 0 || state.order.policy.currentDeductible > 0) && + state.order.payment.insuranceCoverage.coverageStatus === coverageStatus.VERIFIED && !state.order.policy.isNoComp ) { return true; From 15ca0785c16572f82a402d2481f03484ee4e2692 Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Tue, 23 Apr 2024 17:39:47 -0400 Subject: [PATCH 07/43] CSR-1742: update naming and some logic to simplify --- src/fmg-components/cart/cart.vue | 63 +++++++++---------- src/layouts/payment-method/payment-method.vue | 19 ++++-- 2 files changed, 43 insertions(+), 39 deletions(-) diff --git a/src/fmg-components/cart/cart.vue b/src/fmg-components/cart/cart.vue index 0dad87b0d..5b081cd5b 100644 --- a/src/fmg-components/cart/cart.vue +++ b/src/fmg-components/cart/cart.vue @@ -11,7 +11,7 @@ class="col d-flex justify-content-between py-0"> {{ amountDueText }} {{ - isInsuranceStatusPending + isCoverageTypeToDisplayPending ? verifyingCoverageText : getFormattedAmount("", amountDue) }} @@ -24,7 +24,7 @@ {{ - isInsuranceStatusPending + isCoverageTypeToDisplayPending ? verifyingCoverageText : getFormattedAmount("", deductibleLineItem.subTotal) }} @@ -97,8 +97,8 @@ {{ getFormattedAmount(cartItem.category, cartItem.subTotal) }} @@ -106,25 +106,25 @@
- {{ subtotalText }}{{ - isInsuranceStatusPending + {{ subtotalText }} + {{ + isCoverageTypeToDisplayPending ? verifyingCoverageText : getFormattedAmount("", subTotal) }}
- {{ salesTaxText }}{{ getFormattedAmount("", salesTax) }} + {{ salesTaxText }} + {{ getFormattedAmount("", salesTax) }}
{{ amountPaidText }}{{ getFormattedAmount("", amountPaid) }}
- {{ amountDueText }}{{ - isInsuranceStatusPending + {{ amountDueText }} + {{ + isCoverageTypeToDisplayPending ? verifyingCoverageText : getFormattedAmount("", amountDue) }} @@ -188,9 +188,9 @@ export default { allowItemRemoval: Boolean, recyclingModalCmsWidgetName: String, showAsPaid: Boolean, - currentDeductibleFromStore: Number, + insuranceDeductible: Number, insuranceCompanyName: String, - insuranceCoverageStatus: String, + insuranceCoverageTypeToDisplay: String, }, data() { return { @@ -293,22 +293,18 @@ export default { this.$emit("update:modelValue", newValue); }, }, - isInsuranceStatusPending() { - if (this.insuranceCoverageStatus === coverageStatus.PENDING) return true; - if ( - this.insuranceCoverageStatus === coverageStatus.VERIFIED && - !(this.currentDeductible === 0 || this.currentDeductible > 0) - ) - return true; - return false; + isCoverageTypeToDisplayPending() { + return this.insuranceCoverageTypeToDisplay === coverageStatus.PENDING; }, - isInsuranceStatusVerified() { - return this.insuranceCoverageStatus === coverageStatus.VERIFIED; + isCoverageTypeToDisplayVerified() { + return this.insuranceCoverageTypeToDisplay === coverageStatus.VERIFIED; }, currentDeductible() { - if (this.insuranceCoverageStatus === coverageStatus.VERIFIED) - return this.currentDeductibleFromStore; - return null; + const deductible = this.insuranceDeductible; + if (!(deductible === 0 || deductible > 0)) { + global.$logger.logError("Error: currentDeductible should not be null"); + } + return deductible; }, screenReaderTotalAmountDueText() { return this.getCmsContent("ScreenReaderTotalAmountDueWidget", "Text"); @@ -421,10 +417,7 @@ export default { packagePrice() { let packagePrice = 0; - if ( - !this.isInsuranceStatusVerified || - (this.isInsuranceStatusVerified && this.isInsuranceStatusPending) - ) { + if (!this.isCoverageTypeToDisplayVerified) { packagePrice = baseMixin.methods.getTierOnePackagePrice( baseMixin.methods.filterOutFees(this.availableLineItems) ); @@ -476,10 +469,10 @@ export default { deductibleLineItem() { let lineItem = null; - if (this.isInsuranceStatusVerified || this.isInsuranceStatusPending) { + if (this.isCoverageTypeToDisplayVerified || this.isCoverageTypeToDisplayPending) { lineItem = { name: this.deductibleLineItemName, - subTotal: this.currentDeductible >= 0 ? this.currentDeductible : null, + subTotal: this.currentDeductible, }; } @@ -909,7 +902,7 @@ export default { subTotal() { let subTotal = 0; - if (this.isInsuranceStatusVerified) { + if (this.isCoverageTypeToDisplayVerified) { // only include items NOT covered by insurance this.cartItems.forEach((cartItem) => { if (!cartItem.isCoveredByInsurance) { @@ -929,7 +922,7 @@ export default { salesTax() { let salesTax = 0; - if (this.isInsuranceStatusVerified) { + if (this.isCoverageTypeToDisplayVerified) { // only include items NOT covered by insurance this.cartItems.forEach((cartItem) => { if (!cartItem.isCoveredByInsurance) { diff --git a/src/layouts/payment-method/payment-method.vue b/src/layouts/payment-method/payment-method.vue index a97ea9a3a..db82a7a34 100644 --- a/src/layouts/payment-method/payment-method.vue +++ b/src/layouts/payment-method/payment-method.vue @@ -29,9 +29,9 @@ pageName="payment-method" servicePackageOptionsCmsName="ServicePackageTitle" recyclingModalCmsWidgetName="RecycleModal" - :currentDeductibleFromStore="currentDeductible" + :insuranceDeductible="currentDeductible" :insuranceCompanyName="insuranceCompanyName" - :insuranceCoverageStatus="insuranceCoverageStatus" /> + :insuranceCoverageTypeToDisplay="insuranceCoverageTypeToDisplay" />
@@ -335,7 +335,18 @@ export default { (isMobile && mobileReqs) || (!isMobile && dropOffInshopReqs); // 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 const schedule = store.getters.order.schedule; @@ -512,7 +523,7 @@ export default { } return false; }, - insuranceCoverageStatus() { + insuranceCoverageTypeToDisplay() { if (!this.isInsurance) return null; if (this.isNoComp) { return coverageStatus.NOCOMP; From a0a6f1303b62a205350478de68055777d9da7e38 Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Tue, 23 Apr 2024 17:51:44 -0400 Subject: [PATCH 08/43] CSR-1742: update cart test to accept global --- src/fmg-components/cart/cart.spec.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/fmg-components/cart/cart.spec.js b/src/fmg-components/cart/cart.spec.js index bd0a2b096..cbb5a1610 100644 --- a/src/fmg-components/cart/cart.spec.js +++ b/src/fmg-components/cart/cart.spec.js @@ -5,6 +5,13 @@ import cart from "@/fmg-components/cart/cart.vue"; import { shallowMount } from "@vue/test-utils"; 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("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", () => { From 6789713d1dd2d1937f962c939d192c9c0a6a0d8f Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Wed, 24 Apr 2024 09:08:36 -0400 Subject: [PATCH 09/43] prettier --- src/layouts/payment-method/payment-method.vue | 5 ++++- src/store/index.js | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/layouts/payment-method/payment-method.vue b/src/layouts/payment-method/payment-method.vue index db82a7a34..c4e98e114 100644 --- a/src/layouts/payment-method/payment-method.vue +++ b/src/layouts/payment-method/payment-method.vue @@ -340,7 +340,10 @@ export default { const currentDeductible = store.getters.policy.currentDeductible; const isInsuranceSet = () => { if (isInsurance !== null) { - if (insuranceCoverageStatus === coverageStatus.VERIFIED && !(currentDeductible === 0 || currentDeductible > 0) ) { + if ( + insuranceCoverageStatus === coverageStatus.VERIFIED && + !(currentDeductible === 0 || currentDeductible > 0) + ) { return false; // if coverageStatus is verified there must be a valid deductible also } return true; diff --git a/src/store/index.js b/src/store/index.js index ac817c6a1..99d87ba60 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -766,7 +766,8 @@ export const getters = { 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.policy.currentDeductible === 0 || + state.order.policy.currentDeductible > 0) && state.order.payment.insuranceCoverage.coverageStatus === coverageStatus.VERIFIED && !state.order.policy.isNoComp ) { From 9e3eb1df3e8fca25516d90d4184b4a3988416569 Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Wed, 24 Apr 2024 11:29:58 -0400 Subject: [PATCH 10/43] CSR-1742: cart changes for insurance implemented on payment and confirmation pages --- src/layouts/confirmation/confirmation.spec.js | 9 +++++ src/layouts/confirmation/confirmation.vue | 39 ++++++++++++++++++- src/layouts/payment/payment.spec.js | 3 ++ src/layouts/payment/payment.vue | 33 +++++++++++++++- 4 files changed, 81 insertions(+), 3 deletions(-) diff --git a/src/layouts/confirmation/confirmation.spec.js b/src/layouts/confirmation/confirmation.spec.js index 3c0ccee2f..4f201c32d 100644 --- a/src/layouts/confirmation/confirmation.spec.js +++ b/src/layouts/confirmation/confirmation.spec.js @@ -58,6 +58,15 @@ beforeEach(() => { }, payment: { isPia: true, + isInsurance: false, + insuranceCoverage: { + coverageStatus: "test" + } + }, + policy: { + isNoComp: false, + currentDeductible: 1, + insuranceCompanyName: "test name" }, referralNumber: "1234567", vehicle: { diff --git a/src/layouts/confirmation/confirmation.vue b/src/layouts/confirmation/confirmation.vue index 54e40214b..e1bc5bb34 100644 --- a/src/layouts/confirmation/confirmation.vue +++ b/src/layouts/confirmation/confirmation.vue @@ -21,10 +21,12 @@ :displayVehicleImage="vehicleBannerImageUrl" :displayGenericVehicleImage="false" />
+

{{ ScheduleDateFormatted }}

{{ ScheduleTimeFormatted }}

+
+
+ + servicePackageOptionsCmsName="ServicePackageTitle" + :insuranceDeductible="currentDeductible" + :insuranceCompanyName="insuranceCompanyName" + :insuranceCoverageTypeToDisplay="insuranceCoverageTypeToDisplay" /> +
+
+ 0) { + return true; + } + return false; + }, + insuranceCoverageTypeToDisplay() { + 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() { return store.getters.submittedOrder?.payment.isPia; }, diff --git a/src/layouts/payment/payment.spec.js b/src/layouts/payment/payment.spec.js index 34b282e8b..4290a97d4 100644 --- a/src/layouts/payment/payment.spec.js +++ b/src/layouts/payment/payment.spec.js @@ -202,6 +202,9 @@ describe("payment.vue", () => { jobMaxMinutes: "45", }, }, + policy: { + currentDeductible: 1, + }, get payment() { return this.order.payment; }, diff --git a/src/layouts/payment/payment.vue b/src/layouts/payment/payment.vue index bc3e365ad..af61fe6dd 100644 --- a/src/layouts/payment/payment.vue +++ b/src/layouts/payment/payment.vue @@ -53,7 +53,10 @@ :allowItemRemoval="false" v-model="lineItems" servicePackageOptionsCmsName="ServicePackageTitle" - recyclingModalCmsWidgetName="RecycleModal" /> + recyclingModalCmsWidgetName="RecycleModal" + :insuranceDeductible="currentDeductible" + :insuranceCompanyName="insuranceCompanyName" + :insuranceCoverageTypeToDisplay="insuranceCoverageTypeToDisplay" />
@@ -219,9 +222,9 @@ import { queryStrings } from "@/constants/query-strings"; import { getQuerystringParameter } from "@/helpers/querystring-helper"; import { deepClone } from "@/helpers/object-helper"; import { submitWorkOrder } from "@/helpers/heritage-integration/order-helper.js"; - import iframeResize from "../../../node_modules/iframe-resizer/js/iframeResizer.js"; import { routerParams } from "@/router/router-constants/router-params"; +import { coverageStatus } from "@/constants/coverage-status"; export default { name: "payment", @@ -425,6 +428,32 @@ export default { damageInfo() { 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; + }, + insuranceCoverageTypeToDisplay() { + 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() { if (this.paymentType == "pp") { return true; From 40f55c22d526ccc47117e5e15be4bdf0ada7cf09 Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Wed, 24 Apr 2024 14:12:02 -0400 Subject: [PATCH 11/43] prettier. 8-| --- src/layouts/confirmation/confirmation.spec.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/layouts/confirmation/confirmation.spec.js b/src/layouts/confirmation/confirmation.spec.js index 4f201c32d..0d8a1b273 100644 --- a/src/layouts/confirmation/confirmation.spec.js +++ b/src/layouts/confirmation/confirmation.spec.js @@ -60,13 +60,13 @@ beforeEach(() => { isPia: true, isInsurance: false, insuranceCoverage: { - coverageStatus: "test" - } + coverageStatus: "test", + }, }, policy: { isNoComp: false, currentDeductible: 1, - insuranceCompanyName: "test name" + insuranceCompanyName: "test name", }, referralNumber: "1234567", vehicle: { From fd5acc69467fa25b2b00516f5241c4cba6e40e37 Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Wed, 24 Apr 2024 14:39:01 -0400 Subject: [PATCH 12/43] last minute requirements change --- src/fmg-components/cart/cart.vue | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/fmg-components/cart/cart.vue b/src/fmg-components/cart/cart.vue index 5b081cd5b..f969f04e8 100644 --- a/src/fmg-components/cart/cart.vue +++ b/src/fmg-components/cart/cart.vue @@ -130,7 +130,12 @@ }} -
+
{{ insuranceCompanyName }}
Date: Fri, 26 Apr 2024 18:34:39 +0530 Subject: [PATCH 13/43] CSR-1953 deductible scenario --- src/mixins/analytics-mixin.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/mixins/analytics-mixin.js b/src/mixins/analytics-mixin.js index f49521b81..49ce3e29c 100644 --- a/src/mixins/analytics-mixin.js +++ b/src/mixins/analytics-mixin.js @@ -276,7 +276,8 @@ export default { isDefined(order.payment.insuranceCoverage.isVerified) && order.payment.insuranceCoverage.isVerified && isDefined(order.policy.currentDeductible) && - order.policy.currentDeductible == 0 + order.policy.currentDeductible > 0 && + order.policy.currentDeductible != 9999 ) { payload.priceSubTotal = ""; } else if (isPricingAvailable) { @@ -302,7 +303,8 @@ export default { isDefined(order.payment.insuranceCoverage.isVerified) && order.payment.insuranceCoverage.isVerified && isDefined(order.policy.currentDeductible) && - order.policy.currentDeductible == 0 + order.policy.currentDeductible > 0 && + order.policy.currentDeductible != 9999 ) { payload.priceTotal = ""; } else if (isTaxAvailable) { From acfa099d641b4393f7c29429ee770f904ca5e82e Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Tue, 30 Apr 2024 09:50:00 -0400 Subject: [PATCH 14/43] CSR-1742: improve naming and update how pending status displays pricing --- src/fmg-components/cart/cart.vue | 35 +++++++++---------- src/layouts/confirmation/confirmation.vue | 4 +-- src/layouts/payment-method/payment-method.vue | 4 +-- src/layouts/payment/payment.vue | 4 +-- 4 files changed, 22 insertions(+), 25 deletions(-) diff --git a/src/fmg-components/cart/cart.vue b/src/fmg-components/cart/cart.vue index f969f04e8..a5df47da1 100644 --- a/src/fmg-components/cart/cart.vue +++ b/src/fmg-components/cart/cart.vue @@ -11,7 +11,7 @@ class="col d-flex justify-content-between py-0"> {{ amountDueText }} {{ - isCoverageTypeToDisplayPending + showCoverageAsPending ? verifyingCoverageText : getFormattedAmount("", amountDue) }} @@ -24,7 +24,7 @@ {{ - isCoverageTypeToDisplayPending + showCoverageAsPending ? verifyingCoverageText : getFormattedAmount("", deductibleLineItem.subTotal) }} @@ -97,8 +97,8 @@ {{ getFormattedAmount(cartItem.category, cartItem.subTotal) }} @@ -108,7 +108,7 @@
{{ subtotalText }} {{ - isCoverageTypeToDisplayPending + showCoverageAsPending ? verifyingCoverageText : getFormattedAmount("", subTotal) }} @@ -124,17 +124,14 @@
{{ amountDueText }} {{ - isCoverageTypeToDisplayPending + showCoverageAsPending ? verifyingCoverageText : getFormattedAmount("", amountDue) }}
{{ insuranceCompanyName }}
@@ -195,7 +192,7 @@ export default { showAsPaid: Boolean, insuranceDeductible: Number, insuranceCompanyName: String, - insuranceCoverageTypeToDisplay: String, + showInsuranceCoverageAs: String, }, data() { return { @@ -298,11 +295,11 @@ export default { this.$emit("update:modelValue", newValue); }, }, - isCoverageTypeToDisplayPending() { - return this.insuranceCoverageTypeToDisplay === coverageStatus.PENDING; + showCoverageAsPending() { + return this.showInsuranceCoverageAs === coverageStatus.PENDING; }, - isCoverageTypeToDisplayVerified() { - return this.insuranceCoverageTypeToDisplay === coverageStatus.VERIFIED; + showCoverageAsVerified() { + return this.showInsuranceCoverageAs === coverageStatus.VERIFIED; }, currentDeductible() { const deductible = this.insuranceDeductible; @@ -422,7 +419,7 @@ export default { packagePrice() { let packagePrice = 0; - if (!this.isCoverageTypeToDisplayVerified) { + if (!this.showCoverageAsVerified && !this.showCoverageAsPending) { packagePrice = baseMixin.methods.getTierOnePackagePrice( baseMixin.methods.filterOutFees(this.availableLineItems) ); @@ -474,7 +471,7 @@ export default { deductibleLineItem() { let lineItem = null; - if (this.isCoverageTypeToDisplayVerified || this.isCoverageTypeToDisplayPending) { + if (this.showCoverageAsVerified || this.showCoverageAsPending) { lineItem = { name: this.deductibleLineItemName, subTotal: this.currentDeductible, @@ -907,7 +904,7 @@ export default { subTotal() { let subTotal = 0; - if (this.isCoverageTypeToDisplayVerified) { + if (this.showCoverageAsVerified || this.showCoverageAsPending) { // only include items NOT covered by insurance this.cartItems.forEach((cartItem) => { if (!cartItem.isCoveredByInsurance) { @@ -927,7 +924,7 @@ export default { salesTax() { let salesTax = 0; - if (this.isCoverageTypeToDisplayVerified) { + if (this.showCoverageAsVerified || this.showCoverageAsPending) { // only include items NOT covered by insurance this.cartItems.forEach((cartItem) => { if (!cartItem.isCoveredByInsurance) { diff --git a/src/layouts/confirmation/confirmation.vue b/src/layouts/confirmation/confirmation.vue index e1bc5bb34..1947bec22 100644 --- a/src/layouts/confirmation/confirmation.vue +++ b/src/layouts/confirmation/confirmation.vue @@ -56,7 +56,7 @@ servicePackageOptionsCmsName="ServicePackageTitle" :insuranceDeductible="currentDeductible" :insuranceCompanyName="insuranceCompanyName" - :insuranceCoverageTypeToDisplay="insuranceCoverageTypeToDisplay" /> + :showInsuranceCoverageAs="showInsuranceCoverageAs" />
@@ -295,7 +295,7 @@ export default { } return false; }, - insuranceCoverageTypeToDisplay() { + showInsuranceCoverageAs() { if (!this.isInsurance) return null; if (this.isNoComp) { return coverageStatus.NOCOMP; diff --git a/src/layouts/payment-method/payment-method.vue b/src/layouts/payment-method/payment-method.vue index c4e98e114..07414ae7d 100644 --- a/src/layouts/payment-method/payment-method.vue +++ b/src/layouts/payment-method/payment-method.vue @@ -31,7 +31,7 @@ recyclingModalCmsWidgetName="RecycleModal" :insuranceDeductible="currentDeductible" :insuranceCompanyName="insuranceCompanyName" - :insuranceCoverageTypeToDisplay="insuranceCoverageTypeToDisplay" /> + :showInsuranceCoverageAs="showInsuranceCoverageAs" />
@@ -526,7 +526,7 @@ export default { } return false; }, - insuranceCoverageTypeToDisplay() { + showInsuranceCoverageAs() { if (!this.isInsurance) return null; if (this.isNoComp) { return coverageStatus.NOCOMP; diff --git a/src/layouts/payment/payment.vue b/src/layouts/payment/payment.vue index af61fe6dd..90378efea 100644 --- a/src/layouts/payment/payment.vue +++ b/src/layouts/payment/payment.vue @@ -56,7 +56,7 @@ recyclingModalCmsWidgetName="RecycleModal" :insuranceDeductible="currentDeductible" :insuranceCompanyName="insuranceCompanyName" - :insuranceCoverageTypeToDisplay="insuranceCoverageTypeToDisplay" /> + :showInsuranceCoverageAs="showInsuranceCoverageAs" />
@@ -440,7 +440,7 @@ export default { } return false; }, - insuranceCoverageTypeToDisplay() { + showInsuranceCoverageAs() { if (!this.isInsurance) return null; if (this.isNoComp) { return coverageStatus.NOCOMP; From 7fdcaf0ae00be61a80f163fc0385533efdf88722 Mon Sep 17 00:00:00 2001 From: CarlNation <32103961+CarlNation@users.noreply.github.com> Date: Tue, 30 Apr 2024 13:15:37 -0400 Subject: [PATCH 15/43] CSR-2054 CSR-2054 no longer hard code cash parent account for pricing calls --- src/store/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/store/index.js b/src/store/index.js index 684aad2ce..d8306ad09 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -2247,7 +2247,7 @@ export const actions = { // TODO: Insurance pricing...`ParentAccountNumber=${context.getters.order.payment.parentAccountNumber}` let queryString = - `ParentAccountNumber=${applicationConfig.CASH_PARENT_ACCOUNT_NUMBER}` + + `ParentAccountNumber=${context.getters.order.payment.parentAccountNumber}` + `&CTU=${ctuToUse}` + `&CarId=${vehicle.carId}` + `&Make=${vehicle.make}` + @@ -2311,7 +2311,7 @@ export const actions = { let queryString = ""; if (appointmentType == "Mobile") { queryString = - `ParentAccountNumber=${applicationConfig.CASH_PARENT_ACCOUNT_NUMBER}` + + `ParentAccountNumber=${context.getters.order.payment.parentAccountNumber}` + `&BillToAccountNumber=${billToAccountNumber}` + `&ProviderNumber=${providerNumber}` + `&AppointmentType=${appointmentType}` + @@ -2321,7 +2321,7 @@ export const actions = { `&${pricedLineItemsFormattedForRequest}`; } else { queryString = - `ParentAccountNumber=${applicationConfig.CASH_PARENT_ACCOUNT_NUMBER}` + + `ParentAccountNumber=${context.getters.order.payment.parentAccountNumber}` + `&BillToAccountNumber=${billToAccountNumber}` + `&ProviderNumber=${providerNumber}` + `&AppointmentType=${appointmentType}` + From 70300d6e8946448f3abc7c8af14bb17e35de9493 Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Thu, 2 May 2024 08:09:42 -0400 Subject: [PATCH 16/43] CSR-1742: refactor to centralize all insurance constants/helpers --- src/constants/coverage-status.js | 20 -------- src/constants/insurance.js | 30 ++++++++++++ src/constants/pay-with-insurance-states.js | 1 - src/fmg-components/cart/cart.vue | 49 +++++++++++++------ src/layouts/confirmation/confirmation.vue | 2 +- src/layouts/payment-method/payment-method.vue | 2 +- src/layouts/payment/payment.vue | 2 +- src/layouts/quote/quote.vue | 2 +- src/store/index.js | 3 +- 9 files changed, 69 insertions(+), 42 deletions(-) delete mode 100644 src/constants/coverage-status.js create mode 100644 src/constants/insurance.js delete mode 100644 src/constants/pay-with-insurance-states.js diff --git a/src/constants/coverage-status.js b/src/constants/coverage-status.js deleted file mode 100644 index 1c75c00a6..000000000 --- a/src/constants/coverage-status.js +++ /dev/null @@ -1,20 +0,0 @@ -const coverageStatus = { - PENDING: "Pending", - NOCOMP: "NoComp", - VERIFIED: "Verified", -}; - -export function coverageStatusValue(intCoverageStatus) { - switch (intCoverageStatus) { - case 0: - return coverageStatus.PENDING; - case 1: - return coverageStatus.NOCOMP; - case 2: - return coverageStatus.VERIFIED; - default: - return null; - } -} - -export { coverageStatus }; diff --git a/src/constants/insurance.js b/src/constants/insurance.js new file mode 100644 index 000000000..2574fdbc6 --- /dev/null +++ b/src/constants/insurance.js @@ -0,0 +1,30 @@ +import { cartItemTypes } from "@/constants/cart-item-types"; + +export const payWithInsuranceStates = ["AZ", "CT", "FL", "KY", "MA", "MN", "NY", "SC"]; + +export const cartItemTypesCoveredByInsurance = [ + cartItemTypes.GLASS_PARTS, + cartItemTypes.SUPPORTING_ITEMS, + cartItemTypes.RECYCLE_FEE, + cartItemTypes.REPLACE_FEE, + cartItemTypes.SUPPLIES_REPAIR, +]; + +export const coverageStatus = { + PENDING: "Pending", + NOCOMP: "NoComp", + VERIFIED: "Verified", +}; + +export function coverageStatusValue(intCoverageStatus) { + switch (intCoverageStatus) { + case 0: + return coverageStatus.PENDING; + case 1: + return coverageStatus.NOCOMP; + case 2: + return coverageStatus.VERIFIED; + default: + return null; + } +} diff --git a/src/constants/pay-with-insurance-states.js b/src/constants/pay-with-insurance-states.js deleted file mode 100644 index e65589557..000000000 --- a/src/constants/pay-with-insurance-states.js +++ /dev/null @@ -1 +0,0 @@ -export const payWithInsuranceStates = ["AZ", "CT", "FL", "KY", "MA", "MN", "NY", "SC"]; diff --git a/src/fmg-components/cart/cart.vue b/src/fmg-components/cart/cart.vue index a5df47da1..d231862fa 100644 --- a/src/fmg-components/cart/cart.vue +++ b/src/fmg-components/cart/cart.vue @@ -177,7 +177,7 @@ import { getPromoCodeWithoutBundleIdentifier } from "@/helpers/promotions-helper import { partTypeStrings } from "@/constants/part-type-strings"; import { cartItemCategories } from "@/constants/cart-item-categories"; import { cartItemTypes } from "@/constants/cart-item-types"; -import { coverageStatus } from "@/constants/coverage-status"; +import { coverageStatus, cartItemTypesCoveredByInsurance } from "@/constants/insurance"; export default { name: "cart", @@ -520,7 +520,9 @@ export default { subTotal: 0, salesTax: 0, lineItems: [], - isCoveredByInsurance: false, + isCoveredByInsurance: cartItemTypesCoveredByInsurance.includes( + cartItemTypes.FRONT_WIPERS + ), }; frontWiperLineItems.forEach((lineItem) => { @@ -558,7 +560,9 @@ export default { subTotal: 0, salesTax: 0, lineItems: [], - isCoveredByInsurance: false, + isCoveredByInsurance: cartItemTypesCoveredByInsurance.includes( + cartItemTypes.REAR_WIPERS + ), }; rearWiperLineItems.forEach((lineItem) => { @@ -596,7 +600,9 @@ export default { subTotal: 0, salesTax: 0, lineItems: [], - isCoveredByInsurance: false, + isCoveredByInsurance: cartItemTypesCoveredByInsurance.includes( + cartItemTypes.RAIN_DEFENSE + ), }; rainDefenseLineItem.cartItemType = cartItem.cartItemType; @@ -617,7 +623,7 @@ export default { if (this.glassParts.length > 0) { this.glassParts.forEach((lineItem) => { - let glassPartCartItem = { + let cartItem = { name: null, category: cartItemCategories.GLASS_PARTS, cartItemType: cartItemTypes.GLASS_PARTS, @@ -627,24 +633,25 @@ export default { (lineItem.kitPrice ?? 0) + (lineItem.laborAmount ?? 0) + (lineItem.sellingPrice ?? 0), - salesTax: lineItem.salesTax ?? 0, lineItems: [], - isCoveredByInsurance: true, + isCoveredByInsurance: cartItemTypesCoveredByInsurance.includes( + cartItemTypes.GLASS_PARTS + ), }; if (lineItem.childParts?.length > 0) { lineItem.childParts.forEach((childPartLineItem) => { - glassPartCartItem.subTotal += + cartItem.subTotal += (childPartLineItem.kitPrice ?? 0) + (childPartLineItem.laborAmount ?? 0) + (childPartLineItem.sellingPrice ?? 0); - glassPartCartItem.salesTax += childPartLineItem.salesTax; + cartItem.salesTax += childPartLineItem.salesTax; }); } - glassPartCartItems.push(glassPartCartItem); + glassPartCartItems.push(cartItem); }); } @@ -670,7 +677,9 @@ export default { subTotal: 0, salesTax: 0, lineItems: [], - isCoveredByInsurance: true, + isCoveredByInsurance: cartItemTypesCoveredByInsurance.includes( + cartItemTypes.REPLACE_FEE + ), }; recycleFeeLineItem.cartItemType = cartItem.cartItemType; @@ -708,7 +717,9 @@ export default { subTotal: 0, salesTax: 0, lineItems: [], - isCoveredByInsurance: true, + isCoveredByInsurance: cartItemTypesCoveredByInsurance.includes( + cartItemTypes.SUPPLIES_REPAIR + ), }; suppliesRepairLineItem.cartItemType = cartItem.cartItemType; @@ -744,7 +755,9 @@ export default { subTotal: 0, salesTax: 0, lineItems: [], - isCoveredByInsurance: false, + isCoveredByInsurance: cartItemTypesCoveredByInsurance.includes( + cartItemTypes.MOBILE_FEE + ), }; mobileFeeLineItem.cartItemType = cartItem.cartItemType; @@ -778,7 +791,9 @@ export default { subTotal: 0, salesTax: 0, lineItems: [], - isCoveredByInsurance: true, + isCoveredByInsurance: cartItemTypesCoveredByInsurance.includes( + cartItemTypes.SUPPORTING_ITEMS + ), }; otherSupportingItemsLineItems.forEach((lineItem) => { @@ -816,7 +831,9 @@ export default { subTotal: 0, salesTax: 0, lineItems: [], - isCoveredByInsurance: false, + isCoveredByInsurance: cartItemTypesCoveredByInsurance.includes( + cartItemTypes.EARLY_BIRD + ), }; premiumAppointmentDiscountLineItem.cartItemType = cartItem.cartItemType; @@ -862,7 +879,7 @@ export default { subTotal: 0, salesTax: 0, lineItems: [], - isCoveredByInsurance: false, + isCoveredByInsurance: cartItemTypesCoveredByInsurance.includes(promoCode), }; promoLineItems.forEach((promoLineItem) => { diff --git a/src/layouts/confirmation/confirmation.vue b/src/layouts/confirmation/confirmation.vue index 1947bec22..39da072a3 100644 --- a/src/layouts/confirmation/confirmation.vue +++ b/src/layouts/confirmation/confirmation.vue @@ -96,7 +96,7 @@ import { convertDateStringToDate } from "@/layouts/schedule/helpers/schedule-hel import { deepClone } from "@/helpers/object-helper"; import { Form } from "vee-validate"; import { get12HourTimeFormat, get12HourTimeMobileFormat } from "@/helpers/date-helper"; -import { coverageStatus } from "@/constants/coverage-status"; +import { coverageStatus } from "@/constants/insurance"; export default { name: "confirmation", diff --git a/src/layouts/payment-method/payment-method.vue b/src/layouts/payment-method/payment-method.vue index 07414ae7d..f3ada1154 100644 --- a/src/layouts/payment-method/payment-method.vue +++ b/src/layouts/payment-method/payment-method.vue @@ -113,7 +113,7 @@ import { errorMessages } from "@/constants/error-messages"; import { AppointmentTypeStrings } from "@/constants/schedule-constants"; import { partTypeStrings } from "@/constants/part-type-strings"; import { mapTaxedLineItemsToStoreFormat } from "../../store"; -import { coverageStatus } from "@/constants/coverage-status"; +import { coverageStatus } from "@/constants/insurance"; defineRule("option-required", required(errorMessages.OPTION_REQUIRED)); diff --git a/src/layouts/payment/payment.vue b/src/layouts/payment/payment.vue index 90378efea..e21780181 100644 --- a/src/layouts/payment/payment.vue +++ b/src/layouts/payment/payment.vue @@ -224,7 +224,7 @@ import { deepClone } from "@/helpers/object-helper"; import { submitWorkOrder } from "@/helpers/heritage-integration/order-helper.js"; import iframeResize from "../../../node_modules/iframe-resizer/js/iframeResizer.js"; import { routerParams } from "@/router/router-constants/router-params"; -import { coverageStatus } from "@/constants/coverage-status"; +import { coverageStatus } from "@/constants/insurance"; export default { name: "payment", diff --git a/src/layouts/quote/quote.vue b/src/layouts/quote/quote.vue index 065d44e82..c9ddd2f89 100644 --- a/src/layouts/quote/quote.vue +++ b/src/layouts/quote/quote.vue @@ -96,7 +96,7 @@ import { required } from "@/helpers/validation-rules"; import { errorMessages } from "@/constants/error-messages"; import { Form, defineRule } from "vee-validate"; import { applicationConfig } from "@/constants/application-config"; -import { payWithInsuranceStates } from "@/constants/pay-with-insurance-states"; +import { payWithInsuranceStates } from "@/constants/insurance"; import { revalidatePromosAndValidateQueryStringPromo, buildToastMessagesFromRevalidateOrValidatePromoResponse, diff --git a/src/store/index.js b/src/store/index.js index 99d87ba60..cdaea9988 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -33,7 +33,8 @@ import { } from "@/helpers/promotions-helper"; import { getDateDifferenceInDays } from "@/helpers/date-helper"; import sharedMutations from "./vuex-shared-mutations/vuexSharedMutations"; -import { coverageStatus, coverageStatusValue } from "@/constants/coverage-status"; +import { coverageStatus, coverageStatusValue } from "@/constants/insurance"; + // Export State const getDefaultState = () => { return { From f943a3648d594e6c4f57e11a977e053d7de8e454 Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Fri, 3 May 2024 07:45:58 -0400 Subject: [PATCH 17/43] CSR-1742: refactoring logic out of markup --- src/fmg-components/cart/cart.vue | 41 ++++++++++++++------------------ 1 file changed, 18 insertions(+), 23 deletions(-) diff --git a/src/fmg-components/cart/cart.vue b/src/fmg-components/cart/cart.vue index d231862fa..8e15728db 100644 --- a/src/fmg-components/cart/cart.vue +++ b/src/fmg-components/cart/cart.vue @@ -11,9 +11,7 @@ class="col d-flex justify-content-between py-0"> {{ amountDueText }} {{ - showCoverageAsPending - ? verifyingCoverageText - : getFormattedAmount("", amountDue) + getLineItemAmount("", amountDue, showCoverageAsPending) }}
@@ -24,9 +22,11 @@ {{ - showCoverageAsPending - ? verifyingCoverageText - : getFormattedAmount("", deductibleLineItem.subTotal) + getLineItemAmount( + "", + deductibleLineItem.subTotal, + showCoverageAsPending + ) }} @@ -35,12 +35,12 @@
- {{ getFormattedAmount("", packagePrice) }} + {{ getLineItemAmount("", packagePrice) }} - {{ getFormattedAmount("", packagePriceWithoutDiscount) }} + {{ getLineItemAmount("", packagePriceWithoutDiscount) }}
@@ -100,34 +100,26 @@ !showCoverageAsVerified || (showCoverageAsVerified && !cartItem.isCoveredByInsurance) " - >{{ getFormattedAmount(cartItem.category, cartItem.subTotal) }}{{ getLineItemAmount(cartItem.category, cartItem.subTotal) }}
{{ subtotalText }} - {{ - showCoverageAsPending - ? verifyingCoverageText - : getFormattedAmount("", subTotal) - }} + {{ getLineItemAmount("", subTotal, showCoverageAsPending) }}
{{ salesTaxText }} - {{ getFormattedAmount("", salesTax) }} + {{ getLineItemAmount("", salesTax) }}
- {{ amountPaidText }}{{ getFormattedAmount("", amountPaid) }} + {{ amountPaidText }} + {{ getLineItemAmount("", amountPaid) }}
{{ amountDueText }} - {{ - showCoverageAsPending - ? verifyingCoverageText - : getFormattedAmount("", amountDue) - }} + {{ getLineItemAmount("", amountDue, showCoverageAsPending) }}
lineItemsToKeep.cartItemType != cartItemType From cfe63885cf7cd623c7c0efeaefa599548caa0659 Mon Sep 17 00:00:00 2001 From: CarlNation <32103961+CarlNation@users.noreply.github.com> Date: Fri, 3 May 2024 08:04:33 -0400 Subject: [PATCH 18/43] CSR-2067 CSR-2067 clean up the pre reqs for service location --- .../service-location/service-location.vue | 16 +++++++++------- src/store/index.js | 4 +++- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/layouts/service-location/service-location.vue b/src/layouts/service-location/service-location.vue index 89b3320fd..93803ebc9 100644 --- a/src/layouts/service-location/service-location.vue +++ b/src/layouts/service-location/service-location.vue @@ -139,7 +139,7 @@ import { getShopProviderData, } from "@/layouts/service-location/helpers/service-location-helper/service-location-helper"; import { navigateToHeritageFunnel } from "@/helpers/heritage-integration/navigation-helper"; - +import { applicationConfig } from "@/constants/application-config"; import { Provider } from "@/layouts/service-location/classes/provider"; import store from "@/store"; @@ -350,16 +350,18 @@ export default { methods: { arePagePrerequisitesValid() { // insurance drops the recycle fee on replace orders so it won't be in supportingItems - if (store.getters.payment.isInsurance && !store.getters.order.damage.isRepair) { + // we should also have a non cash parent account and a policy number + if (store.getters.payment.isInsurance) { return ( - store.getters.order.serviceLocation.zipCode !== null && - store.getters.payment.isInsurance !== null + store.getters.payment.parentAccountNumber !== + applicationConfig.CASH_PARENT_ACCOUNT_NUMBER && + store.getters.order.policy.policyNumber && + store.getters.order.serviceLocation.zipCode ); } else { return ( - store.getters.lineItems.supportingItems !== null && - store.getters.order.serviceLocation.zipCode !== null && - store.getters.payment.isInsurance !== null + store.getters.lineItems.supportingItems && + store.getters.order.serviceLocation.zipCode ); } }, diff --git a/src/store/index.js b/src/store/index.js index 4c0766448..5ffcf5b41 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -1383,7 +1383,9 @@ export const actions = { getMobileFeePart(context, { pageNameToLog }) { const damageType = context.getters.damage.isRepair ? "Repair" : "Replace"; const parentAccountNumber = context.getters.payment.parentAccountNumber; - const billToAccountNumber = context.getters.payment.billToAccountNumber; + const billToAccountNumber = context.getters.payment.billToAccountNumber + ? context.getters.payment.billToAccountNumber + : applicationConfig.CASH_DEFAULT_BILL_TO_ACCOUNT_NUMBER; return globalMethods.callHttpClient({ method: endpoints.GetMobileFeePart.method, From a8ba1b637126053f57e899f6249763aac28a266c Mon Sep 17 00:00:00 2001 From: CarlNation Date: Fri, 3 May 2024 08:31:14 -0400 Subject: [PATCH 19/43] CSR-2067 CSR-2067 fix tests --- .../service-location/service-location.vue | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/layouts/service-location/service-location.vue b/src/layouts/service-location/service-location.vue index 93803ebc9..8b76a5e78 100644 --- a/src/layouts/service-location/service-location.vue +++ b/src/layouts/service-location/service-location.vue @@ -350,19 +350,26 @@ export default { methods: { arePagePrerequisitesValid() { // insurance drops the recycle fee on replace orders so it won't be in supportingItems - // we should also have a non cash parent account and a policy number if (store.getters.payment.isInsurance) { - return ( + if ( store.getters.payment.parentAccountNumber !== applicationConfig.CASH_PARENT_ACCOUNT_NUMBER && store.getters.order.policy.policyNumber && store.getters.order.serviceLocation.zipCode - ); + ) { + return true; + } else { + return false; + } } else { - return ( + if ( store.getters.lineItems.supportingItems && store.getters.order.serviceLocation.zipCode - ); + ) { + return true; + } else { + return false; + } } }, setData(zipCodeData, serviceabilityDetails, mobileFeePart, shopProviderData) { From 7d8c32b27d03dd0a3480a283a57c9d3873788e71 Mon Sep 17 00:00:00 2001 From: hiteshkumar87 Date: Fri, 3 May 2024 18:32:32 +0530 Subject: [PATCH 20/43] CSR-2083 disabled Continue button by default --- .../insurance-company-question.vue | 14 +++++++++++--- .../insurance-company/insurance-company.vue | 19 ++++++++++++++++--- 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/src/layouts/insurance-company/insurance-company-question.vue b/src/layouts/insurance-company/insurance-company-question.vue index 49e1eb8c8..378d4f4b5 100644 --- a/src/layouts/insurance-company/insurance-company-question.vue +++ b/src/layouts/insurance-company/insurance-company-question.vue @@ -112,9 +112,14 @@ export default { console.error("No insurance companies found"); return; } - const parentAccountNumber = this.getParentAccountNumber(parentAccountName); - this.selectedAccountNumber = parentAccountNumber; - this.selectedAccountName = this.getParentAccountName(parentAccountNumber); + if (parentAccountName) { + const parentAccountNumber = this.getParentAccountNumber(parentAccountName); + this.selectedAccountNumber = parentAccountNumber; + this.selectedAccountName = this.getParentAccountName(parentAccountNumber); + } else { + this.selectedAccountNumber = ""; + this.selectedAccountName = ""; + } }, }, mounted() { @@ -145,6 +150,9 @@ export default { select: function (event, ui) { select(ui.item.value); }, + change: function (event, ui) { + select(ui?.item?.value); + }, }); }, 0); }, diff --git a/src/layouts/insurance-company/insurance-company.vue b/src/layouts/insurance-company/insurance-company.vue index 55a8149e3..a15de8311 100644 --- a/src/layouts/insurance-company/insurance-company.vue +++ b/src/layouts/insurance-company/insurance-company.vue @@ -20,7 +20,7 @@
@@ -44,7 +44,7 @@ import { storeActions } from "@/constants/store-actions"; import { Form, defineRule } from "vee-validate"; import baseMixin from "@/mixins/base-mixin.js"; import { navigateToHeritageFunnel } from "@/helpers/heritage-integration/navigation-helper"; - +import { applicationConfig } from "@/constants/application-config"; import store from "@/store"; export default { @@ -84,9 +84,22 @@ export default { originalList: [], }; }, + computed: { + isParentAccountNumber() { + return !!this.parentAccountNumber; + }, + }, methods: { + isCashParentAccountNumber() { + return ( + applicationConfig.CASH_PARENT_ACCOUNT_NUMBER.toString() === + store.getters.order?.payment?.parentAccountNumber.toString() + ); + }, parentAccountNumberFromStore() { - const accountNumber = store.getters.order?.payment?.parentAccountNumber.toString(); + const accountNumber = !this.isCashParentAccountNumber() + ? store.getters.order?.payment?.parentAccountNumber.toString() + : ""; return accountNumber; }, arePagePrerequisitesValid() { From 7d67941493fb97b77705e07cba62f39df5a71e0a Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Fri, 3 May 2024 10:15:09 -0400 Subject: [PATCH 21/43] CSR-1742: refactoring logic out of markup, part 2 --- src/fmg-components/cart/cart.vue | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/fmg-components/cart/cart.vue b/src/fmg-components/cart/cart.vue index 8e15728db..1ba5ea562 100644 --- a/src/fmg-components/cart/cart.vue +++ b/src/fmg-components/cart/cart.vue @@ -11,7 +11,7 @@ class="col d-flex justify-content-between py-0"> {{ amountDueText }} {{ - getLineItemAmount("", amountDue, showCoverageAsPending) + getLineItemAmount(amountDue, showCoverageAsPending) }} @@ -23,7 +23,6 @@ {{ getLineItemAmount( - "", deductibleLineItem.subTotal, showCoverageAsPending ) @@ -35,12 +34,12 @@
- {{ getLineItemAmount("", packagePrice) }} + {{ getLineItemAmount(packagePrice) }} - {{ getLineItemAmount("", packagePriceWithoutDiscount) }} + {{ getLineItemAmount(packagePriceWithoutDiscount) }}
@@ -100,26 +99,28 @@ !showCoverageAsVerified || (showCoverageAsVerified && !cartItem.isCoveredByInsurance) " - >{{ getLineItemAmount(cartItem.category, cartItem.subTotal) }}
{{ + getLineItemAmount(cartItem.subTotal, null, cartItem.category) + }}
{{ subtotalText }} - {{ getLineItemAmount("", subTotal, showCoverageAsPending) }} + {{ getLineItemAmount(subTotal, showCoverageAsPending) }}
{{ salesTaxText }} - {{ getLineItemAmount("", salesTax) }} + {{ getLineItemAmount(salesTax) }}
{{ amountPaidText }} - {{ getLineItemAmount("", amountPaid) }} + {{ getLineItemAmount(amountPaid) }}
{{ amountDueText }} - {{ getLineItemAmount("", amountDue, showCoverageAsPending) }} + {{ getLineItemAmount(amountDue, showCoverageAsPending) }}
Date: Mon, 6 May 2024 13:37:59 -0400 Subject: [PATCH 22/43] CSR-2072 fix insurance search dropdown after API was updated and case mismatch caused issues. --- .../insurance-company-question.vue | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/layouts/insurance-company/insurance-company-question.vue b/src/layouts/insurance-company/insurance-company-question.vue index 378d4f4b5..1943dd435 100644 --- a/src/layouts/insurance-company/insurance-company-question.vue +++ b/src/layouts/insurance-company/insurance-company-question.vue @@ -96,15 +96,28 @@ export default { findMatches(request, response) { const matches = []; const term = request?.term?.toUpperCase(); + const nonPriorityMatches = []; + this.searchableInsuranceCompanyList.forEach((company, index) => { if ( - company.accountName.indexOf(term) !== -1 || - company.altTerms.indexOf(term) !== -1 + company.accountName.toUpperCase().indexOf(term) !== -1 || + company.altTerms.toUpperCase().indexOf(term) !== -1 ) { matches.push(company.accountName); } }); - response(matches); + + const priorityMatches = matches.filter((companyName, index) => { + if (companyName.toUpperCase().indexOf(term) === 0) { + return companyName; + } else { + nonPriorityMatches.push(companyName); + } + }); + + const prioritizedMatches = [...priorityMatches, ...nonPriorityMatches]; + + response(prioritizedMatches); }, selectInsuranceCompany(parentAccountName) { // this runs upon user selection within jQueryUI Autocomplete From 644cd5a67ba0bb70e4a1b3722215f4b93fc85319 Mon Sep 17 00:00:00 2001 From: Bryan Mauger Date: Mon, 6 May 2024 13:42:00 -0400 Subject: [PATCH 23/43] Add comment. --- src/layouts/insurance-company/insurance-company-question.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/src/layouts/insurance-company/insurance-company-question.vue b/src/layouts/insurance-company/insurance-company-question.vue index 1943dd435..ecbb6876d 100644 --- a/src/layouts/insurance-company/insurance-company-question.vue +++ b/src/layouts/insurance-company/insurance-company-question.vue @@ -107,6 +107,7 @@ export default { } }); + // Prioritize matched typed entries to top of list const priorityMatches = matches.filter((companyName, index) => { if (companyName.toUpperCase().indexOf(term) === 0) { return companyName; From 65d8198b1c91a3bef41212904960abc37b4d267b Mon Sep 17 00:00:00 2001 From: CarlNation Date: Tue, 7 May 2024 10:15:16 -0400 Subject: [PATCH 24/43] CSR-977 CSR-977 Decommission vin capture experiment setting --- src/constants/experiments.js | 1 - .../heritage-integration/navigation-helper.js | 15 ++------------- .../navigation-helper.spec.js | 10 ---------- src/layouts/estimate/estimate.vue | 2 -- 4 files changed, 2 insertions(+), 26 deletions(-) diff --git a/src/constants/experiments.js b/src/constants/experiments.js index bd480636f..059f7f27e 100644 --- a/src/constants/experiments.js +++ b/src/constants/experiments.js @@ -4,7 +4,6 @@ const experimentUniverses = { const experimentSettings = { GOOGLE_CUSTOM_DIMENSION_INDEX: "Google Custom Dimension Index", - SUPPRESS_VIN_CAPTURE: "SuppressVinCapture", DISPLAY_AVAILABILITY_INDICATORS: "DisplayAvailabilityIndicators", PIA_EXPERIENCE: "PIA Experience", PIA_INSURANCE: "DisplayPIAInsurance", diff --git a/src/helpers/heritage-integration/navigation-helper.js b/src/helpers/heritage-integration/navigation-helper.js index cb3844bfc..127397d9f 100644 --- a/src/helpers/heritage-integration/navigation-helper.js +++ b/src/helpers/heritage-integration/navigation-helper.js @@ -5,9 +5,6 @@ import { lazyLoadComponent } from "@/router/dynamic-routing/component-loader.js" import { saveSession } from "@/helpers/heritage-integration/order-helper.js"; import { fmgPageValues } from "@/router/router-constants/fmgPage-values"; import { storeActions } from "@/constants/store-actions.js"; -import { settleAllPromises } from "@/helpers/layout-helper"; -import experimentMixin from "@/mixins/experiment-mixin"; -import { experimentSettings } from "@/constants/experiments"; import { includesWindshieldReplacement } from "@/helpers/damage-helper"; import store from "@/store"; import router from "@/router"; @@ -142,11 +139,7 @@ export async function skipVinLookup() { ? await store.dispatch(storeActions.IS_VIN_OPTIONAL_VEHICLE) : false; - return ( - isVinOptionalVehicle || - !includesWindshieldReplacement() || - experimentMixin.methods.hasSettingEqualTo(experimentSettings.SUPPRESS_VIN_CAPTURE, "true") - ); + return isVinOptionalVehicle || !includesWindshieldReplacement(); } export async function skipVinLookupNotRepair() { @@ -158,11 +151,7 @@ export async function skipVinLookupNotRepair() { ? await store.dispatch(storeActions.IS_VIN_OPTIONAL_VEHICLE) : false; - return ( - isVinOptionalVehicle || - !includesWindshieldReplacement() || - experimentMixin.methods.hasSettingEqualTo(experimentSettings.SUPPRESS_VIN_CAPTURE, "true") - ); + return isVinOptionalVehicle || !includesWindshieldReplacement(); } async function getLazyLoadedComponent(pageName) { diff --git a/src/helpers/heritage-integration/navigation-helper.spec.js b/src/helpers/heritage-integration/navigation-helper.spec.js index 963a6434c..1ec4ba233 100644 --- a/src/helpers/heritage-integration/navigation-helper.spec.js +++ b/src/helpers/heritage-integration/navigation-helper.spec.js @@ -115,16 +115,6 @@ describe("getPageToRouteExistingOrderTo", () => { store.commit(storeMutations.UPDATE_IS_REPAIR, false); store.commit(storeMutations.UPDATE_MAKE, "acura"); - const mockExperimentsList = [ - { - universeName: "ConceptFunnel", - settings: { - SuppressVinCapture: false, - }, - }, - ]; - store.commit(storeMutations.UPDATE_EXPERIMENTS, mockExperimentsList); - // Mock out the lazy load calls for all components. mockLazyLoadComponentReturnValues({ [fmgPageValues.VEHICLE]: true, diff --git a/src/layouts/estimate/estimate.vue b/src/layouts/estimate/estimate.vue index 9c2ce4caf..b298132ca 100644 --- a/src/layouts/estimate/estimate.vue +++ b/src/layouts/estimate/estimate.vue @@ -112,8 +112,6 @@ import { skipVinLookup, skipVinLookupNotRepair, } from "@/helpers/heritage-integration/navigation-helper"; -import experimentMixin from "@/mixins/experiment-mixin"; -import { experimentSettings } from "@/constants/experiments"; import vinPagesMixin from "@/mixins/vin-pages-mixin"; import { navigateToHeritageFunnel } from "@/helpers/heritage-integration/navigation-helper"; import { saveSession } from "@/helpers/heritage-integration/order-helper.js"; From 71db16a0db7ea00fbd7321ec67fa428e1a3d1af4 Mon Sep 17 00:00:00 2001 From: Bryan Mauger Date: Tue, 7 May 2024 11:14:07 -0400 Subject: [PATCH 25/43] CSR-2072 fix ampersand issue. Remove code that bolded letters as you typed. This was causing an issue with ampersands. This 'bold as you type' code was not necessary and it's not a requirement for the project, it was a bonus I added when it was setup initially. --- .../insurance-company/insurance-company-question.vue | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/layouts/insurance-company/insurance-company-question.vue b/src/layouts/insurance-company/insurance-company-question.vue index ecbb6876d..f8f7bbc6a 100644 --- a/src/layouts/insurance-company/insurance-company-question.vue +++ b/src/layouts/insurance-company/insurance-company-question.vue @@ -150,17 +150,6 @@ export default { }, minLength: 0, // Necessary to display fmenu when clearing input - // Bold matching letters as you type in the input - search: function (event, ui) { - setTimeout(() => { - let w = $(this).autocomplete("widget").find("div"); - let regExpString = "(" + this.value + ")"; - let re = new RegExp(regExpString, "i"); - w.html((i, html) => - html.replace(re, "$1") - ); - }, 5); - }, select: function (event, ui) { select(ui.item.value); }, From 792ccd8bce8155609f89cb6bf8e4067705cc7683 Mon Sep 17 00:00:00 2001 From: Bryan Mauger Date: Tue, 7 May 2024 11:16:21 -0400 Subject: [PATCH 26/43] Remove unneeded code. --- src/layouts/insurance-company/insurance-company-question.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/layouts/insurance-company/insurance-company-question.vue b/src/layouts/insurance-company/insurance-company-question.vue index f8f7bbc6a..4f281aaad 100644 --- a/src/layouts/insurance-company/insurance-company-question.vue +++ b/src/layouts/insurance-company/insurance-company-question.vue @@ -150,10 +150,10 @@ export default { }, minLength: 0, // Necessary to display fmenu when clearing input - select: function (event, ui) { + select: function (ui) { select(ui.item.value); }, - change: function (event, ui) { + change: function (ui) { select(ui?.item?.value); }, }); From 10ffe3eeff442714c93b31a5bc2727bc76d1992e Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Tue, 7 May 2024 11:31:51 -0400 Subject: [PATCH 27/43] CSR-1744: prevent PIA if deductible is -zsh --- src/layouts/payment-method/payment-method.vue | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/layouts/payment-method/payment-method.vue b/src/layouts/payment-method/payment-method.vue index f3ada1154..4604c1f4c 100644 --- a/src/layouts/payment-method/payment-method.vue +++ b/src/layouts/payment-method/payment-method.vue @@ -560,9 +560,10 @@ export default { const piaInsurance = this.getSettingValue(experimentSettings.PIA_INSURANCE); const isEnabled = - piaExperience === "PIA Optional" || - piaExperience === "PIA Required" || - piaInsurance === "true"; + (piaExperience === "PIA Optional" || + piaExperience === "PIA Required" || + piaInsurance === "true") && + this.currentDeductible !== 0; return !isEnabled; }, From 6f2904a1993522d49c298c067376ce1b7396f552 Mon Sep 17 00:00:00 2001 From: Bryan Mauger Date: Tue, 7 May 2024 11:53:32 -0400 Subject: [PATCH 28/43] Reinsert event to fix breakage. Ooops. --- src/layouts/insurance-company/insurance-company-question.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/layouts/insurance-company/insurance-company-question.vue b/src/layouts/insurance-company/insurance-company-question.vue index 4f281aaad..f8f7bbc6a 100644 --- a/src/layouts/insurance-company/insurance-company-question.vue +++ b/src/layouts/insurance-company/insurance-company-question.vue @@ -150,10 +150,10 @@ export default { }, minLength: 0, // Necessary to display fmenu when clearing input - select: function (ui) { + select: function (event, ui) { select(ui.item.value); }, - change: function (ui) { + change: function (event, ui) { select(ui?.item?.value); }, }); From de4dd9bada8954c8c3cbd4c287bb2cac0fbe40fc Mon Sep 17 00:00:00 2001 From: Chloe Herd Date: Thu, 9 May 2024 13:07:34 -0400 Subject: [PATCH 29/43] Change location of checks + exact check for "verified" navigation --- .../heritage-integration/navigation-helper.js | 4 +-- .../navigation-helper.spec.js | 8 ++++++ .../vehicle-damage/vehicle-damage.spec.js | 1 + src/layouts/vehicle-damage/vehicle-damage.vue | 2 +- src/layouts/vehicle/vehicle.vue | 2 +- src/layouts/vin-lookup/vin-lookup.spec.js | 1 + src/router/index.js | 28 +++++++++++++++++-- src/store/index.js | 3 ++ 8 files changed, 43 insertions(+), 6 deletions(-) diff --git a/src/helpers/heritage-integration/navigation-helper.js b/src/helpers/heritage-integration/navigation-helper.js index 127397d9f..a0d3bb92c 100644 --- a/src/helpers/heritage-integration/navigation-helper.js +++ b/src/helpers/heritage-integration/navigation-helper.js @@ -30,7 +30,7 @@ export async function getDirectNavigation(toRoute) { // vehicle -> vehicle-damage // quote -> vin-lookup/estimate // insurance-company -> vin-lookup/estimate - if (store.getters.payment.insuranceCoverage.isVerified) { + if (store.getters.requiresVerifiedRedirecting) { if (fmgPageValue === fmgPageValues.VEHICLE) { return fmgPageValues.VEHICLE_DAMAGE; } @@ -74,7 +74,7 @@ export async function getImplicitNavigation(toRoute) { if (quoteComponent.methods.arePagePrerequisitesValid()) { // Do not send to quote if verified insurance user. - if (store.getters.payment.insuranceCoverage.isVerified) { + if (store.getters.requiresVerifiedRedirecting) { return fmgPageValues.HERITAGE; } else { return fmgPageValues.QUOTE; diff --git a/src/helpers/heritage-integration/navigation-helper.spec.js b/src/helpers/heritage-integration/navigation-helper.spec.js index 1ec4ba233..671a1b46e 100644 --- a/src/helpers/heritage-integration/navigation-helper.spec.js +++ b/src/helpers/heritage-integration/navigation-helper.spec.js @@ -361,6 +361,7 @@ describe("getPageToRouteExistingOrderTo", () => { }; store.commit(storeMutations.UPDATE_IS_VERIFIED_INSURANCE, true); + store.commit(storeMutations.UPDATE_REFERRAL_NUMBER, "666666"); // Act const result = await getPageToRouteExistingOrderTo(toRoute); @@ -379,6 +380,7 @@ describe("getPageToRouteExistingOrderTo", () => { }; store.commit(storeMutations.UPDATE_IS_VERIFIED_INSURANCE, true); + store.commit(storeMutations.UPDATE_REFERRAL_NUMBER, "666666"); store.commit(storeMutations.UPDATE_IS_REPAIR, true); store.commit(storeMutations.UPDATE_MAKE, "acura"); @@ -398,6 +400,7 @@ describe("getPageToRouteExistingOrderTo", () => { }; store.commit(storeMutations.UPDATE_IS_VERIFIED_INSURANCE, true); + store.commit(storeMutations.UPDATE_REFERRAL_NUMBER, "666666"); store.commit(storeMutations.UPDATE_IS_REPAIR, true); store.commit(storeMutations.UPDATE_MAKE, "acura"); @@ -419,6 +422,7 @@ describe("getPageToRouteExistingOrderTo", () => { }; store.commit(storeMutations.UPDATE_IS_VERIFIED_INSURANCE, true); + store.commit(storeMutations.UPDATE_REFERRAL_NUMBER, "666666"); store.commit(storeMutations.UPDATE_IS_REPAIR, false); store.commit(storeMutations.UPDATE_MAKE, "acura"); store.commit(storeMutations.UPDATE_GLASS_TO_REPLACE, [ @@ -441,6 +445,7 @@ describe("getPageToRouteExistingOrderTo", () => { }; store.commit(storeMutations.UPDATE_IS_VERIFIED_INSURANCE, true); + store.commit(storeMutations.UPDATE_REFERRAL_NUMBER, "666666"); store.commit(storeMutations.UPDATE_IS_REPAIR, false); store.commit(storeMutations.UPDATE_MAKE, "acura"); store.commit(storeMutations.UPDATE_GLASS_TO_REPLACE, [ @@ -466,6 +471,7 @@ describe("getPageToRouteExistingOrderTo", () => { }; store.commit(storeMutations.UPDATE_IS_VERIFIED_INSURANCE, false); + store.commit(storeMutations.UPDATE_REFERRAL_NUMBER, "55555"); // Act const result = await getPageToRouteExistingOrderTo(toRoute); @@ -483,6 +489,7 @@ describe("getPageToRouteExistingOrderTo", () => { }; store.commit(storeMutations.UPDATE_IS_VERIFIED_INSURANCE, false); + store.commit(storeMutations.UPDATE_REFERRAL_NUMBER, "55555"); // Act const result = await getPageToRouteExistingOrderTo(toRoute); @@ -500,6 +507,7 @@ describe("getPageToRouteExistingOrderTo", () => { }; store.commit(storeMutations.UPDATE_IS_VERIFIED_INSURANCE, false); + store.commit(storeMutations.UPDATE_REFERRAL_NUMBER, "55555"); // Act const result = await getPageToRouteExistingOrderTo(toRoute); diff --git a/src/layouts/vehicle-damage/vehicle-damage.spec.js b/src/layouts/vehicle-damage/vehicle-damage.spec.js index 1a2939d3d..36f694d5e 100644 --- a/src/layouts/vehicle-damage/vehicle-damage.spec.js +++ b/src/layouts/vehicle-damage/vehicle-damage.spec.js @@ -728,6 +728,7 @@ describe("vehicle-damage.vue", () => { getters: { vehicle: {}, payment: { insuranceCoverage: { isVerified: true } }, + requiresVerifiedRedirecting: true, }, }, }, diff --git a/src/layouts/vehicle-damage/vehicle-damage.vue b/src/layouts/vehicle-damage/vehicle-damage.vue index 3b613ad3a..ec19c3800 100644 --- a/src/layouts/vehicle-damage/vehicle-damage.vue +++ b/src/layouts/vehicle-damage/vehicle-damage.vue @@ -541,7 +541,7 @@ export default { return this.$route.params[this.routerParams.DISPLAY_VEHICLE_CHANGE_ALERT]; }, shouldHideBackButton() { - return this.$store.getters.payment.insuranceCoverage.isVerified; + return this.$store.getters.requiresVerifiedRedirecting; }, }, diff --git a/src/layouts/vehicle/vehicle.vue b/src/layouts/vehicle/vehicle.vue index e4a19d335..82dc54f22 100644 --- a/src/layouts/vehicle/vehicle.vue +++ b/src/layouts/vehicle/vehicle.vue @@ -348,7 +348,7 @@ export default { isDisabled(options) { if ( !options.length || - store.getters.payment?.insuranceCoverage?.isVerified || + store.getters.requiresVerifiedRedirecting || getFunnelCookie()?.HasDelayedClaimRegistration ) { return true; diff --git a/src/layouts/vin-lookup/vin-lookup.spec.js b/src/layouts/vin-lookup/vin-lookup.spec.js index 1d7d3f493..39aa0f008 100644 --- a/src/layouts/vin-lookup/vin-lookup.spec.js +++ b/src/layouts/vin-lookup/vin-lookup.spec.js @@ -22,6 +22,7 @@ jest.mock("@/store", () => ({ customer: { emailAddress: "builddigitaltest@safelite.com", }, + referralNumber: "666666", }, payment: { insuranceCoverage: { diff --git a/src/router/index.js b/src/router/index.js index 90ac5881b..8d2a358cb 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -116,6 +116,22 @@ const routes = [ } } + // Reroute around pages that should not be available. + + // Exception 1: Integrated Users should not see vehicle or quote pages. + if (store.getters.requiresVerifiedRedirecting) { + if (to.query.fmgPage === fmgPageValues.VEHICLE) { + to.query.fmgPage = fmgPageValues.VEHICLE_DAMAGE; + } else if ( + to.query.fmgPage === fmgPageValues.QUOTE || + to.query.fmgPage === fmgPageValues.INSURANCE_COMPANY + ) { + // Push to heritage if going to quote & integrated. + await navigateToHeritageFunnel({ shouldSaveSession: false }); + return next(false); + } + } + await runExperiments(to.query.fmgPage); // Process funnel cookie. @@ -228,7 +244,7 @@ router.beforeEach(async (to, from, next) => { // Refresh page if navigating to self to prevent locking. // For now only carved out for vehicle; all modals are opened through anchor tags at the moment, // which also self navigate, but relied on the page remaining the same on self-navigation. - } else if (toQueryPage === fromQueryPage && toQueryPage === funnelStartPageName) { + } else if (toQueryPage === fromQueryPage && toQueryPage === getRedirectedStartPage()) { router.go(0); } else { next(); @@ -477,7 +493,7 @@ async function DisplayPageError() { // we use the pageError querystring as a counter to how many times a user has experienced an error and been routed here. // once they receive more than 1 pageerrors, we'll reset their state to hopefully correct any issues they may be having. var navPage = fmgPageValues.VEHICLE; - if (store.getters.payment.insuranceCoverage.isVerified) { + if (store.getters.requiresVerifiedRedirecting) { navPage = fmgPageValues.VEHICLE_DAMAGE; } @@ -542,4 +558,12 @@ async function runExperiments(nextPage) { ); } +function getRedirectedStartPage() { + if (store.getters.requiresVerifiedRedirect) { + return fmgPageValues.VEHICLE_DAMAGE; + } else { + return funnelStartPageName; + } +} + export default router; diff --git a/src/store/index.js b/src/store/index.js index 5ffcf5b41..5a153e731 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -776,6 +776,9 @@ export const getters = { } return false; }, + requiresVerifiedRedirecting: (state) => { + return state.order?.referralNumber?.length === 6; + }, }; function getNonFalseValuesOfPropertyInArrayOfObjects(array, propertyName) { From 1f781aab036fa48752999eeeedb47d36bbe29be8 Mon Sep 17 00:00:00 2001 From: Chloe Herd Date: Thu, 9 May 2024 13:15:45 -0400 Subject: [PATCH 30/43] Fix Typo --- src/router/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/router/index.js b/src/router/index.js index 8d2a358cb..96ed259ef 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -559,7 +559,7 @@ async function runExperiments(nextPage) { } function getRedirectedStartPage() { - if (store.getters.requiresVerifiedRedirect) { + if (store.getters.requiresVerifiedRedirecting) { return fmgPageValues.VEHICLE_DAMAGE; } else { return funnelStartPageName; From bbb3cafc591d6891bfacc91817a4a34792abff3b Mon Sep 17 00:00:00 2001 From: Chloe Herd Date: Thu, 9 May 2024 15:54:06 -0400 Subject: [PATCH 31/43] Return early so page-not-found errors only create one error on bus. --- src/router/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/router/index.js b/src/router/index.js index 96ed259ef..2ce833135 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -160,6 +160,7 @@ const routes = [ if (!isExistingFmgPageName(to.query.fmgPage)) { console.log("Not an existing fmg page name:" + to.query.fmgPage); GoToFunnelStartOn404(next); + return; } // Get route info for the given url. Names will have a 1:1 relationship with names in the Cms. From 88d34ee9e7752ab639ecbc20d3673581719c68e6 Mon Sep 17 00:00:00 2001 From: CarlNation Date: Tue, 14 May 2024 09:37:47 -0400 Subject: [PATCH 32/43] CSR-1600 CSR-1600 hide mobile fee related data when it does not apply --- .../appointment-type-question.vue | 13 ++++++++++++- .../mobile-location-modal-questions.vue | 3 ++- src/layouts/service-location/service-location.vue | 11 +++++++++++ 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/src/layouts/service-location/appointment-type-question/appointment-type-question.vue b/src/layouts/service-location/appointment-type-question/appointment-type-question.vue index ca452ac01..cedd9f609 100644 --- a/src/layouts/service-location/appointment-type-question/appointment-type-question.vue +++ b/src/layouts/service-location/appointment-type-question/appointment-type-question.vue @@ -32,6 +32,7 @@ export default { cmsWidgetName: String, isServiceableMobile: Boolean, isServiceableInshop: Boolean, + mobileFeeApplies: Boolean, }, computed: { questionText() { @@ -45,7 +46,8 @@ export default { const shouldShowInshop = this.isServiceableInshop; const shouldShowDropoff = this.isServiceableInshop && !this.$store.getters.damage.isRepair; - return this.answersFromCms + + var answers = this.answersFromCms ? this.answersFromCms.filter((answer) => { return ( (answer.Name == AppointmentTypeStrings.IN_SHOP && shouldShowInshop) || @@ -54,6 +56,15 @@ export default { ); }) : []; + + if (!this.mobileFeeApplies) { + answers.forEach((item) => { + if (item.Name.toLowerCase() === "mobile"){ + item.SubText = item.SubText.replace("*",""); + } + }) + } + return answers; }, selectedValue: { get: function () { diff --git a/src/layouts/service-location/mobile-location-modal-questions/mobile-location-modal-questions.vue b/src/layouts/service-location/mobile-location-modal-questions/mobile-location-modal-questions.vue index debc25f89..80c79bb8c 100644 --- a/src/layouts/service-location/mobile-location-modal-questions/mobile-location-modal-questions.vue +++ b/src/layouts/service-location/mobile-location-modal-questions/mobile-location-modal-questions.vue @@ -24,7 +24,7 @@ {{ errorMessage }}
- @@ -153,6 +153,7 @@ export default { alertInvalidZipWidgetName: String, customComponentId: String, validationRules: String, + mobileFeeApplies: Boolean, }, computed: { mobileLocationLinkPromptText() { diff --git a/src/layouts/service-location/service-location.vue b/src/layouts/service-location/service-location.vue index 8b76a5e78..6d366d4e3 100644 --- a/src/layouts/service-location/service-location.vue +++ b/src/layouts/service-location/service-location.vue @@ -67,6 +67,7 @@ :isServiceableMobile="isServiceableMobile" :isServiceableInshop="isServiceableInshop" :isDisplayed="isAppointmentTypeDisplayed" + :mobileFeeApplies="mobileFeeApplies" ref="appointmentTypeQuestion" groupName="appointmentTypeQuestion" cmsWidgetName="AppointmentTypeQuestionWidget" @@ -80,6 +81,7 @@ v-if="selectedAppointmentType === 'Mobile'" v-model="mobileLocationQuestions" :mobileFeePart="mobileFeePart" + :mobileFeeApplies="mobileFeeApplies" @updated-mobile-fee-part="setMobileFeePart" @updated-serviceability="setServiceabilityDetails" @updated-contains-military-base="setContainsMilitaryBase" @@ -300,6 +302,15 @@ export default { return this.isGlassServiceableMobile; } }, + mobileFeeApplies() { + if (this.mobileFeePart) { + return true; + } + else + { + return false; + } + }, isServiceableInshop() { if (this.isRecalibrationServiceableInshop !== null) { return this.isGlassServiceableInshop && this.isRecalibrationServiceableInshop; From 195a0ddb0f6355156c11d939e1facff693905051 Mon Sep 17 00:00:00 2001 From: CarlNation Date: Tue, 14 May 2024 09:58:05 -0400 Subject: [PATCH 33/43] CSR-1600 prettier --- .../appointment-type-question/appointment-type-question.vue | 6 +++--- .../mobile-location-modal-questions.vue | 3 ++- src/layouts/service-location/service-location.vue | 4 +--- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/layouts/service-location/appointment-type-question/appointment-type-question.vue b/src/layouts/service-location/appointment-type-question/appointment-type-question.vue index cedd9f609..64bf159ff 100644 --- a/src/layouts/service-location/appointment-type-question/appointment-type-question.vue +++ b/src/layouts/service-location/appointment-type-question/appointment-type-question.vue @@ -59,10 +59,10 @@ export default { if (!this.mobileFeeApplies) { answers.forEach((item) => { - if (item.Name.toLowerCase() === "mobile"){ - item.SubText = item.SubText.replace("*",""); + if (item.Name.toLowerCase() === "mobile") { + item.SubText = item.SubText.replace("*", ""); } - }) + }); } return answers; }, diff --git a/src/layouts/service-location/mobile-location-modal-questions/mobile-location-modal-questions.vue b/src/layouts/service-location/mobile-location-modal-questions/mobile-location-modal-questions.vue index 80c79bb8c..4558c3294 100644 --- a/src/layouts/service-location/mobile-location-modal-questions/mobile-location-modal-questions.vue +++ b/src/layouts/service-location/mobile-location-modal-questions/mobile-location-modal-questions.vue @@ -24,7 +24,8 @@ {{ errorMessage }} - diff --git a/src/layouts/service-location/service-location.vue b/src/layouts/service-location/service-location.vue index 6d366d4e3..b83db7ebc 100644 --- a/src/layouts/service-location/service-location.vue +++ b/src/layouts/service-location/service-location.vue @@ -305,9 +305,7 @@ export default { mobileFeeApplies() { if (this.mobileFeePart) { return true; - } - else - { + } else { return false; } }, From 0851003ef4432aa604655b9864d924ad09d4d8c2 Mon Sep 17 00:00:00 2001 From: Bryan Mauger Date: Tue, 14 May 2024 16:33:34 -0400 Subject: [PATCH 34/43] Update tint map file for privacy glass. --- src/constants/tint-mapper.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/constants/tint-mapper.js b/src/constants/tint-mapper.js index 519de0855..c290dd1db 100644 --- a/src/constants/tint-mapper.js +++ b/src/constants/tint-mapper.js @@ -33,6 +33,7 @@ const tintMap = { { name: "green tint", src: "Glass-NoShade-GreenTint.svg" }, { name: "gray tint privacy", src: "Glass-NoShade-GrayTint.svg" }, { name: "blue tint", src: "Glass-NoShade-BlueTint.svg" }, + { name: "green tint privacy", src: "Glass-NoShade-Privacy.svg" }, // No shade or tint { name: "clear", src: "Glass-NoShade-NoTint.svg" }, From 73293a721921c769d74e3c5e25f0c932d557521f Mon Sep 17 00:00:00 2001 From: Scott Kiener Date: Wed, 15 May 2024 10:05:27 -0400 Subject: [PATCH 35/43] CSR-2076 | Fix line item IDs mismatch --- src/store/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/store/index.js b/src/store/index.js index 5a153e731..dd8cf38af 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -2172,6 +2172,7 @@ export const actions = { }, saveSupportingItems(context, supportingItems) { + syncLineItemIds(supportingItems, context.state.order.lineItems.supportingItems); if (!deepEqual(supportingItems, context.state.order.lineItems.supportingItems)) { context.dispatch(storeActions.RESET_SERVICE_LOCATION_STATE_AND_DEPENDENCIES); } From a37626cf1db339cc99ccd9eda0364c70f187055a Mon Sep 17 00:00:00 2001 From: CarlNation <32103961+CarlNation@users.noreply.github.com> Date: Wed, 15 May 2024 12:02:04 -0400 Subject: [PATCH 36/43] separate insurance and cash logic for PIA separate insurance and cash logic for PIA --- src/layouts/payment-method/payment-method.vue | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/layouts/payment-method/payment-method.vue b/src/layouts/payment-method/payment-method.vue index 4604c1f4c..0910920a9 100644 --- a/src/layouts/payment-method/payment-method.vue +++ b/src/layouts/payment-method/payment-method.vue @@ -559,11 +559,12 @@ export default { const piaExperience = this.getSettingValue(experimentSettings.PIA_EXPERIENCE); const piaInsurance = this.getSettingValue(experimentSettings.PIA_INSURANCE); - const isEnabled = - (piaExperience === "PIA Optional" || - piaExperience === "PIA Required" || - piaInsurance === "true") && - this.currentDeductible !== 0; + var isEnabled = false; + if (this.isInsurance) { + isEnabled = piaInsurance === "true" && this.currentDeductible !== 0; + } else { + isEnabled = piaExperience === "PIA Optional" || piaExperience === "PIA Required"; + } return !isEnabled; }, From e03dfd65ccfd04096d25d2ab38437c18be603302 Mon Sep 17 00:00:00 2001 From: CarlNation Date: Mon, 20 May 2024 09:39:37 -0400 Subject: [PATCH 37/43] CSR-2098 CSR-2098 handle case where verified insurance with deductible --- src/mixins/base-mixin.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/mixins/base-mixin.js b/src/mixins/base-mixin.js index cf763fdff..ff2ea93d6 100644 --- a/src/mixins/base-mixin.js +++ b/src/mixins/base-mixin.js @@ -152,6 +152,11 @@ export default { if (lineItems.promos) { amountDue += this.getTotalPriceOfAllLineItemsAndChildParts(lineItems.promos, true); } + + if (store.getters.payment.insuranceCoverage.isVerified && !store.getters.policy.isNoComp && !store.getters.policy.isItac) { + amountDue += store.getters.policy.currentDeductible; + } + return ((amountDue * 100) / 100).toFixed(2); }, scrollToPageTop() { From 67610544e00a8e73cd5e3afe75a621b18db8fd1d Mon Sep 17 00:00:00 2001 From: CarlNation Date: Mon, 20 May 2024 09:43:11 -0400 Subject: [PATCH 38/43] CSR-2098 prettier --- src/mixins/base-mixin.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/mixins/base-mixin.js b/src/mixins/base-mixin.js index ff2ea93d6..ec49c3f0f 100644 --- a/src/mixins/base-mixin.js +++ b/src/mixins/base-mixin.js @@ -152,8 +152,12 @@ export default { if (lineItems.promos) { amountDue += this.getTotalPriceOfAllLineItemsAndChildParts(lineItems.promos, true); } - - if (store.getters.payment.insuranceCoverage.isVerified && !store.getters.policy.isNoComp && !store.getters.policy.isItac) { + + if ( + store.getters.payment.insuranceCoverage.isVerified && + !store.getters.policy.isNoComp && + !store.getters.policy.isItac + ) { amountDue += store.getters.policy.currentDeductible; } From 252d5454a1494b2340821f23ebbfbc9982908007 Mon Sep 17 00:00:00 2001 From: Scott Kiener Date: Mon, 20 May 2024 10:00:25 -0400 Subject: [PATCH 39/43] Change deepequals to specific check --- src/store/index.js | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/store/index.js b/src/store/index.js index dd8cf38af..50c6c1612 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -2173,7 +2173,7 @@ export const actions = { saveSupportingItems(context, supportingItems) { syncLineItemIds(supportingItems, context.state.order.lineItems.supportingItems); - if (!deepEqual(supportingItems, context.state.order.lineItems.supportingItems)) { + if (!supportingItemsEqual(supportingItems, context.state.order.lineItems.supportingItems)) { context.dispatch(storeActions.RESET_SERVICE_LOCATION_STATE_AND_DEPENDENCIES); } addGuidToLineItemsIfNotAlreadyThere(supportingItems); @@ -2970,6 +2970,7 @@ function syncLineItemIds(lineItemsWithoutIds, lineItemsWithIds) { } }); if (matchedLineItemIndex > -1) { + // Remove the matched line item clonedLineItemsWithIds.splice(matchedLineItemIndex, 1); } }); @@ -2986,6 +2987,21 @@ function providersEqual(providerA, providerB) { //TODO: Change back to deepEqual once zipCodeCtu is added to saveSession. } +function supportingItemsEqual(supportingItemsA, supportingItemsB) { + if (supportingItemsA.length != supportingItemsB.length) { + return false; + } + const sortedA = supportingItemsA.slice().sort(); + const sortedB = supportingItemsB.slice().sort(); + for (let i = 0; i < sortedA.length; i++) { + if (sortedA[i].partNumber != sortedB[i].partNumber || + sortedA[i].partType != sortedB[i].partType) { + return false; + } + } + return true; +} + // This function will verify schedule info is still valid. // check to see if we have an appointment date on the order object. // if so, make sure it's not in the past. if in the past, clear schedule info in store. From 4830a53fb747983adf23dac395a050f6cd12f982 Mon Sep 17 00:00:00 2001 From: Scott Kiener Date: Mon, 20 May 2024 10:07:51 -0400 Subject: [PATCH 40/43] CSR-2076 | Make equals statement more robust --- src/store/index.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/store/index.js b/src/store/index.js index 50c6c1612..4ee3f3c7a 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -2988,6 +2988,12 @@ function providersEqual(providerA, providerB) { } function supportingItemsEqual(supportingItemsA, supportingItemsB) { + if (typeof supportingItemsA !== typeof supportingItemsB) { + return false; + } + if (supportingItemsA === null || supportingItemsB === null) { + return supportingItemsA === supportingItemsB; + } if (supportingItemsA.length != supportingItemsB.length) { return false; } From 8635ab63e764f9263c9f46d3310ac16db35890f1 Mon Sep 17 00:00:00 2001 From: Scott Kiener Date: Mon, 20 May 2024 10:17:58 -0400 Subject: [PATCH 41/43] CSR-2076 | Formatting --- src/store/index.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/store/index.js b/src/store/index.js index 4ee3f3c7a..aa1979e0a 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -3000,10 +3000,12 @@ function supportingItemsEqual(supportingItemsA, supportingItemsB) { const sortedA = supportingItemsA.slice().sort(); const sortedB = supportingItemsB.slice().sort(); for (let i = 0; i < sortedA.length; i++) { - if (sortedA[i].partNumber != sortedB[i].partNumber || - sortedA[i].partType != sortedB[i].partType) { - return false; - } + if ( + sortedA[i].partNumber != sortedB[i].partNumber || + sortedA[i].partType != sortedB[i].partType + ) { + return false; + } } return true; } From 91b4036cd5308d93b1d76f0ce116bf21d6f00543 Mon Sep 17 00:00:00 2001 From: CarlNation Date: Mon, 20 May 2024 10:26:26 -0400 Subject: [PATCH 42/43] CSR-2098 CSR-2098 unit test for verified deductible --- src/mixins/base-mixin.spec.js | 40 +++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/src/mixins/base-mixin.spec.js b/src/mixins/base-mixin.spec.js index 2ef76315e..cd18ecd7d 100644 --- a/src/mixins/base-mixin.spec.js +++ b/src/mixins/base-mixin.spec.js @@ -120,6 +120,46 @@ describe("baseMixin.js", () => { expect(mixIn.methods.dispatchStoreActionWithLogging).toBeCalled(); }); + + test("getAmountDue for verified deductible should be deductible plus any lineitems", () => { + const mixIn = getMixInInstance({}); + const lineItems = { + glassParts: [], + supportingItems: [], + vaps: [ + { + cartItemType: "FRONT WIPERS", + description: 'WIPER BLADE STANDARD 18"', + kitPrice: 0, + laborAmount: 0, + partNumber: "WB18", + partType: "FRONT WIPER", + salesTax: 2.00, + sellingPrice: 30.00, + }, + { + cartItemType: "FRONT WIPERS", + description: 'WIPER BLADE STANDARD 26"', + kitPrice: 0, + laborAmount: 0, + partNumber: "WB26", + partType: "FRONT WIPER", + salesTax: 1.00, + sellingPrice: 20.00, + }, + ], + promos: [], + }; + + store.getters = { + payment: {insuranceCoverage: { isVerified: true } }, + policy: { isNoComp: false, isItac: false, currentDeductible: 250 }, + }; + + var amtDue = mixIn.methods.getAmountDue(lineItems); + + expect(amtDue).toEqual("303.00"); + }); }); function getMixInInstance({ isDispatchSuccess = true }) { From 831685aa5f85b3442c9470136cd66005079c0ae7 Mon Sep 17 00:00:00 2001 From: CarlNation Date: Mon, 20 May 2024 10:29:28 -0400 Subject: [PATCH 43/43] CSR-2098 prettier --- src/mixins/base-mixin.spec.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/mixins/base-mixin.spec.js b/src/mixins/base-mixin.spec.js index cd18ecd7d..1b0f919ba 100644 --- a/src/mixins/base-mixin.spec.js +++ b/src/mixins/base-mixin.spec.js @@ -134,8 +134,8 @@ describe("baseMixin.js", () => { laborAmount: 0, partNumber: "WB18", partType: "FRONT WIPER", - salesTax: 2.00, - sellingPrice: 30.00, + salesTax: 2.0, + sellingPrice: 30.0, }, { cartItemType: "FRONT WIPERS", @@ -144,15 +144,15 @@ describe("baseMixin.js", () => { laborAmount: 0, partNumber: "WB26", partType: "FRONT WIPER", - salesTax: 1.00, - sellingPrice: 20.00, + salesTax: 1.0, + sellingPrice: 20.0, }, ], promos: [], }; store.getters = { - payment: {insuranceCoverage: { isVerified: true } }, + payment: { insuranceCoverage: { isVerified: true } }, policy: { isNoComp: false, isItac: false, currentDeductible: 250 }, };