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, const { firstName,
lastName, lastName,
emailAddress, emailAddress,
homePhone } = useMainStore().contactInfo; servicePhone } = useMainStore().contactInfo;
this.firstName = firstName; this.firstName = firstName;
this.lastName = lastName; this.lastName = lastName;
this.emailAddress = emailAddress; this.emailAddress = emailAddress;
this.phoneNumber = homePhone; this.phoneNumber = servicePhone;
}, },
openModal() { openModal() {
this.modal.openModal(); this.modal.openModal();

View file

@ -119,8 +119,7 @@ export const getDefaultState = () => ({
}, },
firstName: null, firstName: null,
lastName: null, lastName: null,
emailAddress: null, emailAddress: null
homePhone: null
}, },
serviceLocation: { serviceLocation: {
address: null, address: null,
@ -558,7 +557,7 @@ export const useMainStore = defineStore({
country: 'US' // TODO set from store country: 'US' // TODO set from store
}, },
homePhone: { homePhone: {
number: this.order.customer.phoneNumber?.replaceAll(nonNumberCharRegex, '') ?? '' number: this.order.customerInfo?.homePhone?.replaceAll(nonNumberCharRegex, '') ?? ''
} }
}, },
driver: { driver: {
@ -1208,7 +1207,7 @@ export const useMainStore = defineStore({
policyHolder: { policyHolder: {
policyFirstName: customer.firstName, policyFirstName: customer.firstName,
policyLastName: customer.lastName, policyLastName: customer.lastName,
policyPhoneNumber: customer.phoneNumber, policyPhoneNumber: contactInfo.servicePhone,
policyEmail: customer.emailAddress, policyEmail: customer.emailAddress,
policyState: customer.address.state policyState: customer.address.state
}, },
@ -1331,7 +1330,6 @@ export const useMainStore = defineStore({
order.customer.emailAddress = data.customer?.emailAddress; order.customer.emailAddress = data.customer?.emailAddress;
order.customer.firstName = data.customer?.firstName; order.customer.firstName = data.customer?.firstName;
order.customer.lastName = data.customer?.lastName; order.customer.lastName = data.customer?.lastName;
order.customer.phoneNumber = data?.customer?.phoneNumber;
order.customer.address.streetAddress = data.customer?.address?.streetAddress; order.customer.address.streetAddress = data.customer?.address?.streetAddress;
order.customer.address.streetAddress2 = data.customer?.address?.streetAddress2; 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.damageState = welcomePageModel?.damageState;
this.order.policy.damageCity = welcomePageModel?.damageCity; this.order.policy.damageCity = welcomePageModel?.damageCity;
this.order.policy.isDamageGlassOnly = welcomePageModel?.isDamageGlassOnly; this.order.policy.isDamageGlassOnly = welcomePageModel?.isDamageGlassOnly;
this.order.customer.phoneNumber = welcomePageModel?.phoneNumber;
this.order.customer.emailAddress = welcomePageModel?.email; this.order.customer.emailAddress = welcomePageModel?.email;
this.updatePhoneNumbers({ this.updatePhoneNumbers({
home: welcomePageModel?.phoneNumber, home: welcomePageModel?.phoneNumber,
@ -2331,7 +2328,6 @@ export const useMainStore = defineStore({
this.order.policy.damageCity = null; this.order.policy.damageCity = null;
this.order.policy.damageState = null; this.order.policy.damageState = null;
this.order.policy.isITAC = false; this.order.policy.isITAC = false;
this.order.customer.phoneNumber = null;
this.order.customer.emailAddress = null; this.order.customer.emailAddress = null;
this.order.customer.firstName = null; this.order.customer.firstName = null;
this.order.customer.lastName = null; this.order.customer.lastName = null;

View file

@ -680,8 +680,9 @@ describe('Store', () => {
store.order.customer.firstName = customerFirstName; store.order.customer.firstName = customerFirstName;
store.order.customer.lastName = customerLastName; store.order.customer.lastName = customerLastName;
store.order.customer.emailAddress = customerEmail; store.order.customer.emailAddress = customerEmail;
store.order.customer.phoneNumber = customerPhoneNumber;
store.order.customer.address.state = customerState; store.order.customer.address.state = customerState;
store.order.contactInfo.homePhone = customerPhoneNumber;
store.order.contactInfo.servicePhone = customerPhoneNumber;
store.order.policy.policyNumber = policyNumber; store.order.policy.policyNumber = policyNumber;
store.order.policy.policyZipCode = policyZipCode; store.order.policy.policyZipCode = policyZipCode;
store.order.policy.policyLookupSuccessful = policyLookupSuccessful; store.order.policy.policyLookupSuccessful = policyLookupSuccessful;
@ -1142,7 +1143,7 @@ describe('Store', () => {
expect(store.order.customer.firstName).toBe(customer.firstName); expect(store.order.customer.firstName).toBe(customer.firstName);
expect(store.order.customer.lastName).toBe(customer.lastName); expect(store.order.customer.lastName).toBe(customer.lastName);
expect(store.order.customer.emailAddress).toBe(customer.emailAddress); 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 () => { it('sets expected remaining order data', async () => {
// Arrange // Arrange