From 970dbde3043c3793d04219f632298dd7599446d5 Mon Sep 17 00:00:00 2001 From: Bill Richardson Date: Tue, 10 Oct 2023 10:32:19 -0400 Subject: [PATCH 01/20] smh --- src/store/index.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/store/index.js b/src/store/index.js index 77af754d..b9d40f81 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -1086,16 +1086,16 @@ export const useMainStore = defineStore({ this.order.vehicle.registration.lastName = registrationInfo?.lastName; }, updateServiceLocation(serviceLocationInfo) { - state.order.serviceLocation.address = serviceLocationInfo.address; - state.order.serviceLocation.address2 = serviceLocationInfo.address2; - state.order.serviceLocation.city = serviceLocationInfo.city; - state.order.serviceLocation.state = serviceLocationInfo.state; - state.order.serviceLocation.zipCode = serviceLocationInfo.zipCode; - state.order.serviceLocation.zipCodeCtu = serviceLocationInfo.zipCodeCtu; - state.order.serviceLocation.appointmentType = serviceLocationInfo.appointmentType; - state.order.serviceLocation.isVehicleProtected = serviceLocationInfo.isVehicleProtected; + this.order.serviceLocation.address = serviceLocationInfo.address; + this.order.serviceLocation.address2 = serviceLocationInfo.address2; + this.order.serviceLocation.city = serviceLocationInfo.city; + this.order.serviceLocation.state = serviceLocationInfo.state; + this.order.serviceLocation.zipCode = serviceLocationInfo.zipCode; + this.order.serviceLocation.zipCodeCtu = serviceLocationInfo.zipCodeCtu; + this.order.serviceLocation.appointmentType = serviceLocationInfo.appointmentType; + this.order.serviceLocation.isVehicleProtected = serviceLocationInfo.isVehicleProtected; - state.order.serviceLocation.provider = { + this.order.serviceLocation.provider = { providerNumber: serviceLocationInfo.provider?.providerNumber, address: { streetAddress: serviceLocationInfo.provider?.address?.streetAddress, From a6b5ac7ab4399e95f15131c32debf1ef8bef8bcb Mon Sep 17 00:00:00 2001 From: Josh Dassinger Date: Tue, 10 Oct 2023 13:16:49 -0500 Subject: [PATCH 02/20] SSR-627 Date Of Loss must be within the last 10 years --- src/constants/error-messages.js | 2 ++ src/layouts/welcome-page/welcome-page.vue | 12 +++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/constants/error-messages.js b/src/constants/error-messages.js index f91c7a2b..0c8d4719 100644 --- a/src/constants/error-messages.js +++ b/src/constants/error-messages.js @@ -41,6 +41,8 @@ const errorMessages = Object.freeze({ LOSS_STATE_REQUIRED: 'Please select an option', LOSS_DATE_REQUIRED: 'Please select a date. Format must be MM/DD/YYYY and the date must be not in the future', + DAMAGE_DATE_REQUIREMENT: + 'Damage date must be within the past 10 years', DAMAGE_OPTION_REQUIRED: 'Please select an option', POLICYHOLDER_FIRST_NAME_REQUIRED: 'Please enter the policyholder first name', diff --git a/src/layouts/welcome-page/welcome-page.vue b/src/layouts/welcome-page/welcome-page.vue index d2ad05b0..ee29c984 100644 --- a/src/layouts/welcome-page/welcome-page.vue +++ b/src/layouts/welcome-page/welcome-page.vue @@ -198,6 +198,16 @@ defineRule( 'policy-zip-format', regex(/(^\d{5}$)|(^\d{5}-\d{4}$)/, errorMessages.POLICY_ZIP_FORMAT) ); +defineRule('loss-date-gt-10-years', (value) => { + const lossDate = new Date(Date.parse(`${value}T00:00:00`)); + const today = new Date(); + const tenYearsAgo = new Date(today.getFullYear() - 10, today.getMonth(), today.getDate(), 0, 0, 0, 0); + if (lossDate < tenYearsAgo) { + return errorMessages.DAMAGE_DATE_REQUIREMENT; + } + + return true; +}); export default { name: 'welcome-page', @@ -248,7 +258,7 @@ export default { rules: { policyNumber: 'policy-number-required', policyZip: 'policy-zip-required|policy-zip-format', - lossDate: 'loss-date-required', + lossDate: 'loss-date-required|loss-date-gt-10-years', damageOption: 'damage-option-required', phoneNumber: `${globalRules.PHONE_NUMBER_REQUIRED}|${globalRules.PHONE_NUMBER_FORMAT}`, email: `${globalRules.EMAIL_ADDRESS_REQUIRED}|${globalRules.EMAIL_ADDRESS_FORMAT}`, From 327b826bdfb6a69a74a59bd94cd505c38d5814a7 Mon Sep 17 00:00:00 2001 From: Bill Richardson Date: Thu, 12 Oct 2023 11:39:30 -0400 Subject: [PATCH 03/20] Update to include noComp for Mobile messaging --- .../appointment-type-question.vue | 7 +++++-- .../mobile-location-modal-questions.vue | 9 +++++++-- src/styles/ux-variables-svg-strings.scss | 3 ++- 3 files changed, 14 insertions(+), 5 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 dc7dadb2..56f02e2a 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 @@ -51,8 +51,8 @@ export default { return this.getCmsContent(this.cmsWidgetName, 'Answers'); }, answersToDisplay() { - const shouldShowMobile = this.isServiceableMobile && this.isITAC; - const shouldShowMobileNotITAC = this.isServiceableMobile && !this.isITAC; + const shouldShowMobile = this.isServiceableMobile && this.isItacOrNoComp; + const shouldShowMobileNotITAC = this.isServiceableMobile && !this.isItacOrNoComp; const shouldShowInshop = this.isServiceableInshop; const shouldShowDropoff = this.isServiceableInshop && !useMainStore().damage.isRepair; return this.answersFromCms @@ -75,6 +75,9 @@ export default { isITAC() { return useMainStore().policy.isITAC; }, + isItacOrNoComp() { + return useMainStore().policy.isITAC || useMainStore().policy.noCoverage; + }, isMobileOnly() { return this.isServiceableMobile && !this.isServiceableInshop; } 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 3829dd76..73698e45 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 @@ -31,7 +31,7 @@ @@ -172,6 +172,9 @@ export default { isITAC() { return useMainStore().policy.isITAC; }, + isItacOrNoComp() { + return useMainStore().policy.isITAC || useMainStore().policy.noCoverage; + }, mobileLocationLinkPromptText() { return this.getCmsContent(this.linkWidgetName, 'HeaderText'); }, @@ -298,6 +301,8 @@ export default {