From dc43455d92d206da25208d7b6514696ecdfd006b Mon Sep 17 00:00:00 2001 From: CarlNation Date: Tue, 15 Aug 2023 09:39:15 -0400 Subject: [PATCH] CSR-1564 CSR-1559 registration defaults CSR-1564 CSR-1559 registration defaults --- src/constants/store-mutations.js | 7 --- src/layouts/address-lookup/address-lookup.vue | 4 -- .../license-plate-lookup.vue | 2 - src/store/index.js | 43 ++----------------- src/store/store.spec.js | 2 +- 5 files changed, 5 insertions(+), 53 deletions(-) diff --git a/src/constants/store-mutations.js b/src/constants/store-mutations.js index 795eb62c9..fd568ead7 100644 --- a/src/constants/store-mutations.js +++ b/src/constants/store-mutations.js @@ -23,13 +23,6 @@ const storeMutations = { UPDATE_SUPPORTING_ITEMS: "updateSupportingItems", UPDATE_LINE_ITEMS_SERVER_DATA: "updateLineItemsServerData", - UPDATE_REGISTRATION_LICENSE_PLATE: "updateRegistrationLicensePlate", - UPDATE_REGISTRATION_ADDRESS: "updateRegistrationAddress", - UPDATE_REGISTRATION_CITY: "updateRegistrationCity", - UPDATE_REGISTRATION_STATE: "updateRegistrationState", - UPDATE_REGISTRATION_ZIP_CODE: "updateRegistrationZipCode", - UPDATE_REGISTRATION_FIRST_NAME: "updateRegistrationFirstName", - UPDATE_REGISTRATION_LAST_NAME: "updateRegistrationLastName", UPDATE_REGISTRATION: "updateRegistration", UPDATE_SERVICE_ZIP: "updateServiceZip", diff --git a/src/layouts/address-lookup/address-lookup.vue b/src/layouts/address-lookup/address-lookup.vue index fe3b00320..48ab0dd08 100644 --- a/src/layouts/address-lookup/address-lookup.vue +++ b/src/layouts/address-lookup/address-lookup.vue @@ -323,10 +323,6 @@ export default { registrationInfo: { firstName: this.customerQuestions.firstName, lastName: this.customerQuestions.lastName, - address: this.customerQuestions.addressQuestions.streetAddress, - city: this.customerQuestions.addressQuestions.city, - state: resultMap.serviceZipValidationResponse.state, - zipCode: this.customerQuestions.addressQuestions.zipCode, }, }, false diff --git a/src/layouts/license-plate-lookup/license-plate-lookup.vue b/src/layouts/license-plate-lookup/license-plate-lookup.vue index 49ff8ff26..326215243 100644 --- a/src/layouts/license-plate-lookup/license-plate-lookup.vue +++ b/src/layouts/license-plate-lookup/license-plate-lookup.vue @@ -292,8 +292,6 @@ export default { vehicleInfo: Object.assign(vinLookup.data.vehicle, { vin: vinLookup.data.vin }), registrationInfo: { licensePlate: this.licensePlate, - state: resultMap.registrationZipValidationResponse.state, - zipCode: this.registrationZipCode, }, }, false diff --git a/src/store/index.js b/src/store/index.js index b64a09aa7..c3b599138 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -39,12 +39,6 @@ const getDefaultState = () => { imageColor: null, registration: { licensePlate: null, - address: null, - city: null, - state: null, - zipCode: null, - firstName: null, - lastName: null, }, }, serviceLocation: { @@ -217,27 +211,6 @@ export const mutations = { updateInsuranceVerifiedStatus(state, isVerified) { state.order.payment.insuranceCoverage.isVerified = isVerified; }, - updateRegistrationLicensePlate(state, licensePlate) { - state.order.vehicle.registration.licensePlate = licensePlate; - }, - updateRegistrationAddress(state, registrationAddress) { - state.order.vehicle.registration.address = registrationAddress; - }, - updateRegistrationCity(state, registrationCity) { - state.order.vehicle.registration.city = registrationCity; - }, - updateRegistrationState(state, registrationState) { - state.order.vehicle.registration.state = registrationState; - }, - updateRegistrationZipCode(state, registrationZipCode) { - state.order.vehicle.registration.zipCode = registrationZipCode; - }, - updateRegistrationFirstName(state, firstName) { - state.order.vehicle.registration.firstName = firstName; - }, - updateRegistrationLastName(state, lastName) { - state.order.vehicle.registration.lastName = lastName; - }, updateCustomerEmailAddress(state, customerEmailAddress) { state.order.customer.emailAddress = customerEmailAddress; }, @@ -358,12 +331,8 @@ export const mutations = { }, resetRegistrationState(state) { state.order.vehicle.registration.licensePlate = null; - state.order.vehicle.registration.address = null; - state.order.vehicle.registration.city = null; - state.order.vehicle.registration.state = null; - state.order.vehicle.registration.zipCode = null; - state.order.vehicle.registration.firstName = null; - state.order.vehicle.registration.lastName = null; + state.order.customer.firstName = null; + state.order.customer.lastName = null; }, resetGlassPartsState(state) { state.order.lineItems.glassParts = null; @@ -1775,12 +1744,8 @@ export const actions = { ) { //Reset dependent state when changing if ( - registrationInfo?.address !== context.state.order.vehicle.registration?.address || - registrationInfo?.city !== context.state.order.vehicle.registration?.city || - registrationInfo?.state !== context.state.order.vehicle.registration?.state || - registrationInfo?.zipCode !== context.state.order.vehicle.registration?.zipCode || - registrationInfo?.firstName !== context.state.order.vehicle.registration?.firstName || - registrationInfo?.lastName !== context.state.order.vehicle.registration?.lastName + registrationInfo?.firstName !== context.state.order.customer?.firstName || + registrationInfo?.lastName !== context.state.order.customer?.lastName ) { context.dispatch(storeActions.RESET_REGISTRATION_STATE_AND_DEPENDENCIES); diff --git a/src/store/store.spec.js b/src/store/store.spec.js index e813cb21e..f70bbd3d1 100644 --- a/src/store/store.spec.js +++ b/src/store/store.spec.js @@ -1552,7 +1552,7 @@ describe("Actions", () => { isCarIdDifferent: true, isSelectedGlassAvailableForVehicle: false, vehicleInfo: { carId: "C010101", vin: "XXXXX" }, - registrationInfo: { zipCode: "80020", address: "123 Marys Ave" }, + registrationInfo: { firstName: "abc", lastName: "123" }, serviceLocationInfo: { state: "CO" }, customerEmail: "test@safelite.com", };