From 117a5f191e8f5d34062848c0ebabbb90f7c73b5c Mon Sep 17 00:00:00 2001 From: Josh Dassinger Date: Fri, 12 Apr 2024 08:04:35 -0500 Subject: [PATCH] SSR-1125 Phone Number PR Changes --- .../contact-details-drawer/contact-details-drawer.vue | 4 ++-- src/store/index.js | 10 +++------- src/store/store.spec.js | 5 +++-- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/src/layouts/tpa-submit/contact-details-drawer/contact-details-drawer.vue b/src/layouts/tpa-submit/contact-details-drawer/contact-details-drawer.vue index 3a690b75..334ba86a 100644 --- a/src/layouts/tpa-submit/contact-details-drawer/contact-details-drawer.vue +++ b/src/layouts/tpa-submit/contact-details-drawer/contact-details-drawer.vue @@ -132,11 +132,11 @@ export default { const { firstName, lastName, emailAddress, - homePhone } = useMainStore().contactInfo; + servicePhone } = useMainStore().contactInfo; this.firstName = firstName; this.lastName = lastName; this.emailAddress = emailAddress; - this.phoneNumber = homePhone; + this.phoneNumber = servicePhone; }, openModal() { this.modal.openModal(); diff --git a/src/store/index.js b/src/store/index.js index 4651f17f..c3728ae3 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -119,8 +119,7 @@ export const getDefaultState = () => ({ }, firstName: null, lastName: null, - emailAddress: null, - homePhone: null + emailAddress: null }, serviceLocation: { address: null, @@ -558,7 +557,7 @@ export const useMainStore = defineStore({ country: 'US' // TODO set from store }, homePhone: { - number: this.order.customer.phoneNumber?.replaceAll(nonNumberCharRegex, '') ?? '' + number: this.order.customerInfo?.homePhone?.replaceAll(nonNumberCharRegex, '') ?? '' } }, driver: { @@ -1208,7 +1207,7 @@ export const useMainStore = defineStore({ policyHolder: { policyFirstName: customer.firstName, policyLastName: customer.lastName, - policyPhoneNumber: customer.phoneNumber, + policyPhoneNumber: contactInfo.servicePhone, policyEmail: customer.emailAddress, policyState: customer.address.state }, @@ -1331,7 +1330,6 @@ export const useMainStore = defineStore({ order.customer.emailAddress = data.customer?.emailAddress; order.customer.firstName = data.customer?.firstName; order.customer.lastName = data.customer?.lastName; - order.customer.phoneNumber = data?.customer?.phoneNumber; order.customer.address.streetAddress = data.customer?.address?.streetAddress; order.customer.address.streetAddress2 = data.customer?.address?.streetAddress2; @@ -1782,7 +1780,6 @@ export const useMainStore = defineStore({ this.order.policy.damageState = welcomePageModel?.damageState; this.order.policy.damageCity = welcomePageModel?.damageCity; this.order.policy.isDamageGlassOnly = welcomePageModel?.isDamageGlassOnly; - this.order.customer.phoneNumber = welcomePageModel?.phoneNumber; this.order.customer.emailAddress = welcomePageModel?.email; this.updatePhoneNumbers({ home: welcomePageModel?.phoneNumber, @@ -2331,7 +2328,6 @@ export const useMainStore = defineStore({ this.order.policy.damageCity = null; this.order.policy.damageState = null; this.order.policy.isITAC = false; - this.order.customer.phoneNumber = null; this.order.customer.emailAddress = null; this.order.customer.firstName = null; this.order.customer.lastName = null; diff --git a/src/store/store.spec.js b/src/store/store.spec.js index be6a3ab8..8c7382ff 100644 --- a/src/store/store.spec.js +++ b/src/store/store.spec.js @@ -680,8 +680,9 @@ describe('Store', () => { store.order.customer.firstName = customerFirstName; store.order.customer.lastName = customerLastName; store.order.customer.emailAddress = customerEmail; - store.order.customer.phoneNumber = customerPhoneNumber; store.order.customer.address.state = customerState; + store.order.contactInfo.homePhone = customerPhoneNumber; + store.order.contactInfo.servicePhone = customerPhoneNumber; store.order.policy.policyNumber = policyNumber; store.order.policy.policyZipCode = policyZipCode; store.order.policy.policyLookupSuccessful = policyLookupSuccessful; @@ -1142,7 +1143,7 @@ describe('Store', () => { expect(store.order.customer.firstName).toBe(customer.firstName); expect(store.order.customer.lastName).toBe(customer.lastName); expect(store.order.customer.emailAddress).toBe(customer.emailAddress); - expect(store.order.customer.phoneNumber).toBe(customer.phoneNumber); + expect(store.order.contactInfo.homePhone).toBe(customer.phoneNumber); }); it('sets expected remaining order data', async () => { // Arrange