From 9e3eb1df3e8fca25516d90d4184b4a3988416569 Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Wed, 24 Apr 2024 11:29:58 -0400 Subject: [PATCH 1/2] 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 2/2] 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: {