From 7f634c4db8577ef567778ec057dd32c7af4f379d Mon Sep 17 00:00:00 2001 From: CarlNation Date: Fri, 12 May 2023 13:27:00 -0400 Subject: [PATCH 1/3] CSR-1115 --- .../service-location/service-location.vue | 28 ++++++++++- src/store/index.js | 48 ++++++++++++++++++- 2 files changed, 72 insertions(+), 4 deletions(-) diff --git a/src/layouts/service-location/service-location.vue b/src/layouts/service-location/service-location.vue index 5ab45533e..f8771c530 100644 --- a/src/layouts/service-location/service-location.vue +++ b/src/layouts/service-location/service-location.vue @@ -161,6 +161,7 @@ export default { selectedProviderNumber: this.getSelectedProvider().providerNumber, mobileFeePart: null, zipContainsMilitaryBase: false, + zipCodeCtu: null, }; }, async beforeRouteEnter(to, from, next) { @@ -323,6 +324,7 @@ export default { setData(zipCodeData, serviceabilityDetails, mobileFeePart) { if (zipCodeData) { this.zipContainsMilitaryBase = zipCodeData.containsMilitaryBase; + this.zipCodeCtu = zipCodeData.zipCodeCtu; } if (serviceabilityDetails) { @@ -377,8 +379,30 @@ export default { backButtonAction() { this.$router.navigateWithoutSaving(this.navigationScenarios.CLICKED_BACK, this.$route); }, - forwardButtonAction() { - this.$router.navigateWithoutSaving( + async forwardButtonAction() { + await this.dispatchStoreAction( + this.storeActions.SAVE_SERVICE_LOCATION, + { + address: this.streetAddress, + address2: this.apartmentNumberOrBusinessName, + city: this.city, + state: this.state, + zipCode: this.zipCode, + zipCodeCtu: this.zipCodeCtu, + appointmentType: this.selectedAppointmentType, + isVehicleProtected: this.isVehicleProtected, + provider: { + providerNumber: this.selectedProvider.providerNumber, + address: this.selectedProvider.address.streetAddress, + city: this.selectedProvider.address.city, + state: this.selectedProvider.address.state, + zip: this.selectedProvider.address.zipCode, + }, + }, + false + ); + + this.$router.navigateWithSaving( this.navigationScenarios.SELECTED_LOCATION, this.$route ); diff --git a/src/store/index.js b/src/store/index.js index ea3521a3b..0abab4727 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -44,6 +44,13 @@ const getDefaultState = () => { zipCode: null, zipCodeCtu: null, appointmentType: null, + provider: { + providerNumber: null, + address: null, + city: null, + state: null, + zip: null, + }, }, customer: { emailAddress: null, @@ -226,10 +233,22 @@ export const mutations = { }, updateServiceLocation(state, 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; + + if (serviceLocationInfo.provider) { + state.order.serviceLocation.provider.providerNumber = + serviceLocationInfo.provider?.providerNumber; + state.order.serviceLocation.provider.address = serviceLocationInfo.provider?.address; + state.order.serviceLocation.provider.city = serviceLocationInfo.provider?.city; + state.order.serviceLocation.provider.state = serviceLocationInfo.provider?.state; + state.order.serviceLocation.provider.zip = serviceLocationInfo.provider?.zip; + } }, // applicationUser MUTATIONS @@ -358,15 +377,31 @@ export const mutations = { state.order.lineItems.serverData = sessionInformation.order.lineItems.serverData; state.order.payment.parentAccountNumber = sessionInformation.order.payment.parentAccountNumber; - state.order.providerNumber = sessionInformation.order.providerNumber; (state.order.serviceLocation.address = sessionInformation.order.serviceLocation.streetAddress), + (state.order.serviceLocation.address2 = + sessionInformation.order.serviceLocation.address2), (state.order.serviceLocation.city = sessionInformation.order.serviceLocation.city), (state.order.serviceLocation.state = sessionInformation.order.serviceLocation.state), (state.order.serviceLocation.zipCode = sessionInformation.order.serviceLocation.zipCode), (state.order.serviceLocation.zipCodeCtu = sessionInformation.order.serviceLocation.zipCodeCtu); + state.order.serviceLocation.appointmentType = + sessionInformation.order.serviceLocation.appointmentType; + state.order.serviceLocation.isVehicleProtected = + sessionInformation.order.serviceLocation.isVehicleProtected; + + state.order.serviceLocation.provider.providerNumber = + sessionInformation.order.serviceLocation.provider?.providerNumber; + state.order.serviceLocation.provider.address = + sessionInformation.order.serviceLocation.provider?.address; + state.order.serviceLocation.provider.city = + sessionInformation.order.serviceLocation.provider?.city; + state.order.serviceLocation.provider.state = + sessionInformation.order.serviceLocation.provider?.state; + state.order.serviceLocation.provider.zip = + sessionInformation.order.serviceLocation.provider?.zip; state.order.payment.isInsurance = sessionInformation.order.payment.isInsurance; state.order.payment.insuranceCoverage.isVerified = @@ -1120,13 +1155,22 @@ export const actions = { isInsurance: order.payment.isInsurance ?? false, parentAccountNumber: order.payment.parentAccountNumber, }, - providerNumber: "", serviceLocation: { streetAddress: order.serviceLocation.address, + streetAddress2: order.serviceLocation.address2, city: order.serviceLocation.city, state: order.serviceLocation.state, zipCode: order.serviceLocation.zipCode, zipCodeCtu: order.serviceLocation.zipCodeCtu, + appointmentType: order.serviceLocation.appointmentType, + isVehicleProtected: order.serviceLocation.isVehicleProtected, + provider: { + providerNumber: order.serviceLocation.provider?.providerNumber, + address: order.serviceLocation.provider?.address, + city: order.serviceLocation.provider?.city, + state: order.serviceLocation.provider?.state, + zip: order.serviceLocation.provider?.zip, + }, }, existingPromoCode: null, referralCorrelationId: order.referralCorrelationId, From 76136bc311d3b2115b77ff14dd079bd82a083f23 Mon Sep 17 00:00:00 2001 From: CarlNation Date: Fri, 12 May 2023 13:59:09 -0400 Subject: [PATCH 2/3] CSR-1115 --- src/store/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/store/index.js b/src/store/index.js index 0abab4727..9e9587131 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -243,7 +243,7 @@ export const mutations = { if (serviceLocationInfo.provider) { state.order.serviceLocation.provider.providerNumber = - serviceLocationInfo.provider?.providerNumber; + serviceLocationInfo.provider.providerNumber; state.order.serviceLocation.provider.address = serviceLocationInfo.provider?.address; state.order.serviceLocation.provider.city = serviceLocationInfo.provider?.city; state.order.serviceLocation.provider.state = serviceLocationInfo.provider?.state; From de4568f9f3324f12203e7eb1e160bc03b3cc49eb Mon Sep 17 00:00:00 2001 From: CarlNation Date: Fri, 12 May 2023 14:26:09 -0400 Subject: [PATCH 3/3] CSR-1115 --- src/store/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/store/index.js b/src/store/index.js index 9e9587131..0abab4727 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -243,7 +243,7 @@ export const mutations = { if (serviceLocationInfo.provider) { state.order.serviceLocation.provider.providerNumber = - serviceLocationInfo.provider.providerNumber; + serviceLocationInfo.provider?.providerNumber; state.order.serviceLocation.provider.address = serviceLocationInfo.provider?.address; state.order.serviceLocation.provider.city = serviceLocationInfo.provider?.city; state.order.serviceLocation.provider.state = serviceLocationInfo.provider?.state;