diff --git a/src/store/index.js b/src/store/index.js index a137dd7ef..1feb02a2f 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -678,34 +678,38 @@ export const mutations = { sessionInformation.order.payment.billToAccountNumber; state.order.payment.inactivePromos = sessionInformation.order.payment.inactivePromos; - state.order.serviceLocation.address = - sessionInformation.order.serviceLocation.streetAddress; - state.order.serviceLocation.address2 = - sessionInformation.order.serviceLocation.streetAddress2; - 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; + //Do not assign default service type once user make service type selection + if (state.order.serviceLocation.appointmentType == null) { + state.order.serviceLocation.address = + sessionInformation.order.serviceLocation.streetAddress; + state.order.serviceLocation.address2 = + sessionInformation.order.serviceLocation.streetAddress2; + 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.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.streetAddress = - sessionInformation.order.serviceLocation.provider?.address?.streetAddress; - state.order.serviceLocation.provider.address.city = - sessionInformation.order.serviceLocation.provider?.address?.city; - state.order.serviceLocation.provider.address.state = - sessionInformation.order.serviceLocation.provider?.address?.state; - state.order.serviceLocation.provider.address.zipCode = - sessionInformation.order.serviceLocation.provider?.address?.zipCode; - state.order.serviceLocation.provider.address.zipCodeCtu = - sessionInformation.order.serviceLocation.provider?.address?.zipCodeCtu; - state.order.serviceLocation.techNotes = sessionInformation.order.serviceLocation.techNotes; + state.order.serviceLocation.provider.providerNumber = + sessionInformation.order.serviceLocation.provider?.providerNumber; + state.order.serviceLocation.provider.address.streetAddress = + sessionInformation.order.serviceLocation.provider?.address?.streetAddress; + state.order.serviceLocation.provider.address.city = + sessionInformation.order.serviceLocation.provider?.address?.city; + state.order.serviceLocation.provider.address.state = + sessionInformation.order.serviceLocation.provider?.address?.state; + state.order.serviceLocation.provider.address.zipCode = + sessionInformation.order.serviceLocation.provider?.address?.zipCode; + state.order.serviceLocation.provider.address.zipCodeCtu = + sessionInformation.order.serviceLocation.provider?.address?.zipCodeCtu; + state.order.serviceLocation.techNotes = + sessionInformation.order.serviceLocation.techNotes; + } // if we're loading a session and we do not have a provider number yet, then set isInsurance to null so that // a service package is not selected by default on the quote page. @@ -749,14 +753,15 @@ export const mutations = { state.applicationUser.savedSessionId = sessionInformation.applicationUser.savedSessionId; } - - state.order.schedule.date = sessionInformation.order.schedule?.date; - state.order.schedule.startTime = sessionInformation.order.schedule?.startTime; - state.order.schedule.endTime = sessionInformation.order.schedule?.endTime; - state.order.schedule.routeCode = sessionInformation.order.schedule?.routeCode; - state.order.schedule.jobMaxMinutes = sessionInformation.order.schedule?.jobMaxMinutes; - state.order.schedule.jobMinMinutes = sessionInformation.order.schedule?.jobMinMinutes; - + //Do not assign default schedule details once user make schedule selection + if (state.order.schedule.date == null) { + state.order.schedule.date = sessionInformation.order.schedule?.date; + state.order.schedule.startTime = sessionInformation.order.schedule?.startTime; + state.order.schedule.endTime = sessionInformation.order.schedule?.endTime; + state.order.schedule.routeCode = sessionInformation.order.schedule?.routeCode; + state.order.schedule.jobMaxMinutes = sessionInformation.order.schedule?.jobMaxMinutes; + state.order.schedule.jobMinMinutes = sessionInformation.order.schedule?.jobMinMinutes; + } state.order.policy.currentDeductible = sessionInformation.order.policy?.currentDeductible; state.order.policy.originalDeductible = sessionInformation.order.policy?.originalDeductible; state.order.policy.additionalAuthFlag = sessionInformation.order.policy?.additionalAuthFlag; @@ -2274,7 +2279,7 @@ export const actions = { response.data ); - await resetScheduleIfUnavailable(context, response.data.order, pageNameToLog); + await resetScheduleIfUnavailable(context, context.state.order, pageNameToLog); return response; }, (error) => {