Merge pull request #1834 from Safelite/feature/CSR-1742-ajc

CSR-1742: cart changes for insurance implemented on payment and confirmation pages
This commit is contained in:
AdamCaouetteSafelite 2024-04-24 14:20:26 -04:00 committed by GitHub
commit 26fc42f37d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 81 additions and 3 deletions

View file

@ -58,6 +58,15 @@ beforeEach(() => {
},
payment: {
isPia: true,
isInsurance: false,
insuranceCoverage: {
coverageStatus: "test",
},
},
policy: {
isNoComp: false,
currentDeductible: 1,
insuranceCompanyName: "test name",
},
referralNumber: "1234567",
vehicle: {

View file

@ -21,10 +21,12 @@
:displayVehicleImage="vehicleBannerImageUrl"
:displayGenericVehicleImage="false" />
</div>
<div class="scheduleText">
<p>{{ ScheduleDateFormatted }}</p>
<p>{{ ScheduleTimeFormatted }}</p>
</div>
<addToCalendar
mobileWidgetName="AddToCalendar_Mobile"
inShopWidgetName="AddToCalendar_InShop"
@ -41,7 +43,9 @@
<div class="appoinmenttext" v-html="AppointmentWordingText"></div>
</div>
<hr />
<cart
v-if="ShowCart"
:damage="damageInfo"
@ -49,9 +53,15 @@
:allowItemRemoval="false"
v-model="lineItems"
:showAsPaid="isPia"
servicePackageOptionsCmsName="ServicePackageTitle" />
servicePackageOptionsCmsName="ServicePackageTitle"
:insuranceDeductible="currentDeductible"
:insuranceCompanyName="insuranceCompanyName"
:insuranceCoverageTypeToDisplay="insuranceCoverageTypeToDisplay" />
<hr class="mb-5" />
<div class="emailtext" v-html="ConfirmationEmailText"></div>
<navbar
cmsWidgetName="FunnelFooterWidget"
ref="navbar"
@ -86,6 +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";
export default {
name: "confirmation",
@ -272,6 +283,32 @@ export default {
damageInfo() {
return store.getters.submittedOrder.damage;
},
isInsurance() {
return store.getters.submittedOrder.payment.isInsurance;
},
isNoComp() {
return store.getters.submittedOrder.policy.isNoComp;
},
hasVapsInCart() {
if (this.lineItems?.vaps?.length > 0) {
return true;
}
return false;
},
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;
},

View file

@ -202,6 +202,9 @@ describe("payment.vue", () => {
jobMaxMinutes: "45",
},
},
policy: {
currentDeductible: 1,
},
get payment() {
return this.order.payment;
},

View file

@ -53,7 +53,10 @@
:allowItemRemoval="false"
v-model="lineItems"
servicePackageOptionsCmsName="ServicePackageTitle"
recyclingModalCmsWidgetName="RecycleModal" />
recyclingModalCmsWidgetName="RecycleModal"
:insuranceDeductible="currentDeductible"
:insuranceCompanyName="insuranceCompanyName"
:insuranceCoverageTypeToDisplay="insuranceCoverageTypeToDisplay" />
<hr class="mb-5" />
@ -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;