SSR-1125 Phone Number PR Changes

This commit is contained in:
Josh Dassinger 2024-04-12 08:04:35 -05:00
parent 1c6b56b4e9
commit 117a5f191e
3 changed files with 8 additions and 11 deletions

View file

@ -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();

View file

@ -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;

View file

@ -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