001// --------------------------------------------------------------------------------
002// Copyright 2002-2026 Echo Three, LLC
003//
004// Licensed under the Apache License, Version 2.0 (the "License");
005// you may not use this file except in compliance with the License.
006// You may obtain a copy of the License at
007//
008//     http://www.apache.org/licenses/LICENSE-2.0
009//
010// Unless required by applicable law or agreed to in writing, software
011// distributed under the License is distributed on an "AS IS" BASIS,
012// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013// See the License for the specific language governing permissions and
014// limitations under the License.
015// --------------------------------------------------------------------------------
016
017package com.echothree.control.user.customer.server;
018
019import com.echothree.control.user.customer.common.CustomerRemote;
020import com.echothree.control.user.customer.common.form.*;
021import com.echothree.control.user.customer.common.result.*;
022import com.echothree.control.user.customer.server.command.*;
023import com.echothree.model.data.user.common.pk.UserVisitPK;
024import com.echothree.util.common.command.CommandResult;
025import com.echothree.util.common.command.VoidResult;
026import javax.ejb.Stateless;
027import javax.enterprise.inject.spi.CDI;
028
029@Stateless
030public class CustomerBean
031        extends CustomerFormsImpl
032        implements CustomerRemote, CustomerLocal {
033    
034    // -------------------------------------------------------------------------
035    //   Testing
036    // -------------------------------------------------------------------------
037    
038    @Override
039    public String ping() {
040        return "CustomerBean is alive!";
041    }
042    
043    // -------------------------------------------------------------------------
044    //   Customers
045    // -------------------------------------------------------------------------
046
047    @Override
048    public CommandResult<GetCustomersResult> getCustomers(UserVisitPK userVisitPK, GetCustomersForm form) {
049        return CDI.current().select(GetCustomersCommand.class).get().run(userVisitPK, form);
050    }
051
052    @Override
053    public CommandResult<GetCustomerResult> getCustomer(UserVisitPK userVisitPK, GetCustomerForm form) {
054        return CDI.current().select(GetCustomerCommand.class).get().run(userVisitPK, form);
055    }
056
057    @Override
058    public CommandResult<EditCustomerResult> editCustomer(UserVisitPK userVisitPK, EditCustomerForm form) {
059        return CDI.current().select(EditCustomerCommand.class).get().run(userVisitPK, form);
060    }
061    
062    @Override
063    public CommandResult<GetCustomerStatusChoicesResult> getCustomerStatusChoices(UserVisitPK userVisitPK, GetCustomerStatusChoicesForm form) {
064        return CDI.current().select(GetCustomerStatusChoicesCommand.class).get().run(userVisitPK, form);
065    }
066    
067    @Override
068    public CommandResult<VoidResult> setCustomerStatus(UserVisitPK userVisitPK, SetCustomerStatusForm form) {
069        return CDI.current().select(SetCustomerStatusCommand.class).get().run(userVisitPK, form);
070    }
071    
072    @Override
073    public CommandResult<GetCustomerCreditStatusChoicesResult> getCustomerCreditStatusChoices(UserVisitPK userVisitPK, GetCustomerCreditStatusChoicesForm form) {
074        return CDI.current().select(GetCustomerCreditStatusChoicesCommand.class).get().run(userVisitPK, form);
075    }
076    
077    @Override
078    public CommandResult<VoidResult> setCustomerCreditStatus(UserVisitPK userVisitPK, SetCustomerCreditStatusForm form) {
079        return CDI.current().select(SetCustomerCreditStatusCommand.class).get().run(userVisitPK, form);
080    }
081    
082    // -------------------------------------------------------------------------
083    //   Customer Types
084    // -------------------------------------------------------------------------
085    
086    @Override
087    public CommandResult<CreateCustomerTypeResult> createCustomerType(UserVisitPK userVisitPK, CreateCustomerTypeForm form) {
088        return CDI.current().select(CreateCustomerTypeCommand.class).get().run(userVisitPK, form);
089    }
090    
091    @Override
092    public CommandResult<GetCustomerTypesResult> getCustomerTypes(UserVisitPK userVisitPK, GetCustomerTypesForm form) {
093        return CDI.current().select(GetCustomerTypesCommand.class).get().run(userVisitPK, form);
094    }
095    
096    @Override
097    public CommandResult<GetCustomerTypeResult> getCustomerType(UserVisitPK userVisitPK, GetCustomerTypeForm form) {
098        return CDI.current().select(GetCustomerTypeCommand.class).get().run(userVisitPK, form);
099    }
100    
101    @Override
102    public CommandResult<GetCustomerTypeChoicesResult> getCustomerTypeChoices(UserVisitPK userVisitPK, GetCustomerTypeChoicesForm form) {
103        return CDI.current().select(GetCustomerTypeChoicesCommand.class).get().run(userVisitPK, form);
104    }
105    
106    @Override
107    public CommandResult<VoidResult> setDefaultCustomerType(UserVisitPK userVisitPK, SetDefaultCustomerTypeForm form) {
108        return CDI.current().select(SetDefaultCustomerTypeCommand.class).get().run(userVisitPK, form);
109    }
110    
111    @Override
112    public CommandResult<EditCustomerTypeResult> editCustomerType(UserVisitPK userVisitPK, EditCustomerTypeForm form) {
113        return CDI.current().select(EditCustomerTypeCommand.class).get().run(userVisitPK, form);
114    }
115    
116    @Override
117    public CommandResult<VoidResult> deleteCustomerType(UserVisitPK userVisitPK, DeleteCustomerTypeForm form) {
118        return CDI.current().select(DeleteCustomerTypeCommand.class).get().run(userVisitPK, form);
119    }
120    
121    // -------------------------------------------------------------------------
122    //   Customer Type Descriptions
123    // -------------------------------------------------------------------------
124    
125    @Override
126    public CommandResult<VoidResult> createCustomerTypeDescription(UserVisitPK userVisitPK, CreateCustomerTypeDescriptionForm form) {
127        return CDI.current().select(CreateCustomerTypeDescriptionCommand.class).get().run(userVisitPK, form);
128    }
129    
130    @Override
131    public CommandResult<GetCustomerTypeDescriptionsResult> getCustomerTypeDescriptions(UserVisitPK userVisitPK, GetCustomerTypeDescriptionsForm form) {
132        return CDI.current().select(GetCustomerTypeDescriptionsCommand.class).get().run(userVisitPK, form);
133    }
134    
135    @Override
136    public CommandResult<EditCustomerTypeDescriptionResult> editCustomerTypeDescription(UserVisitPK userVisitPK, EditCustomerTypeDescriptionForm form) {
137        return CDI.current().select(EditCustomerTypeDescriptionCommand.class).get().run(userVisitPK, form);
138    }
139    
140    @Override
141    public CommandResult<VoidResult> deleteCustomerTypeDescription(UserVisitPK userVisitPK, DeleteCustomerTypeDescriptionForm form) {
142        return CDI.current().select(DeleteCustomerTypeDescriptionCommand.class).get().run(userVisitPK, form);
143    }
144    
145    // -------------------------------------------------------------------------
146    //   Customer Type Payment Methods
147    // -------------------------------------------------------------------------
148    
149    @Override
150    public CommandResult<VoidResult> createCustomerTypePaymentMethod(UserVisitPK userVisitPK, CreateCustomerTypePaymentMethodForm form) {
151        return CDI.current().select(CreateCustomerTypePaymentMethodCommand.class).get().run(userVisitPK, form);
152    }
153    
154    @Override
155    public CommandResult<GetCustomerTypePaymentMethodResult> getCustomerTypePaymentMethod(UserVisitPK userVisitPK, GetCustomerTypePaymentMethodForm form) {
156        return CDI.current().select(GetCustomerTypePaymentMethodCommand.class).get().run(userVisitPK, form);
157    }
158    
159    @Override
160    public CommandResult<GetCustomerTypePaymentMethodsResult> getCustomerTypePaymentMethods(UserVisitPK userVisitPK, GetCustomerTypePaymentMethodsForm form) {
161        return CDI.current().select(GetCustomerTypePaymentMethodsCommand.class).get().run(userVisitPK, form);
162    }
163    
164    @Override
165    public CommandResult<VoidResult> setDefaultCustomerTypePaymentMethod(UserVisitPK userVisitPK, SetDefaultCustomerTypePaymentMethodForm form) {
166        return CDI.current().select(SetDefaultCustomerTypePaymentMethodCommand.class).get().run(userVisitPK, form);
167    }
168    
169    @Override
170    public CommandResult<EditCustomerTypePaymentMethodResult> editCustomerTypePaymentMethod(UserVisitPK userVisitPK, EditCustomerTypePaymentMethodForm form) {
171        return CDI.current().select(EditCustomerTypePaymentMethodCommand.class).get().run(userVisitPK, form);
172    }
173    
174    @Override
175    public CommandResult<VoidResult> deleteCustomerTypePaymentMethod(UserVisitPK userVisitPK, DeleteCustomerTypePaymentMethodForm form) {
176        return CDI.current().select(DeleteCustomerTypePaymentMethodCommand.class).get().run(userVisitPK, form);
177    }
178    
179    // -------------------------------------------------------------------------
180    //   Customer Type Shipping Methods
181    // -------------------------------------------------------------------------
182    
183    @Override
184    public CommandResult<VoidResult> createCustomerTypeShippingMethod(UserVisitPK userVisitPK, CreateCustomerTypeShippingMethodForm form) {
185        return CDI.current().select(CreateCustomerTypeShippingMethodCommand.class).get().run(userVisitPK, form);
186    }
187    
188    @Override
189    public CommandResult<GetCustomerTypeShippingMethodResult> getCustomerTypeShippingMethod(UserVisitPK userVisitPK, GetCustomerTypeShippingMethodForm form) {
190        return CDI.current().select(GetCustomerTypeShippingMethodCommand.class).get().run(userVisitPK, form);
191    }
192    
193    @Override
194    public CommandResult<GetCustomerTypeShippingMethodsResult> getCustomerTypeShippingMethods(UserVisitPK userVisitPK, GetCustomerTypeShippingMethodsForm form) {
195        return CDI.current().select(GetCustomerTypeShippingMethodsCommand.class).get().run(userVisitPK, form);
196    }
197    
198    @Override
199    public CommandResult<VoidResult> setDefaultCustomerTypeShippingMethod(UserVisitPK userVisitPK, SetDefaultCustomerTypeShippingMethodForm form) {
200        return CDI.current().select(SetDefaultCustomerTypeShippingMethodCommand.class).get().run(userVisitPK, form);
201    }
202    
203    @Override
204    public CommandResult<EditCustomerTypeShippingMethodResult> editCustomerTypeShippingMethod(UserVisitPK userVisitPK, EditCustomerTypeShippingMethodForm form) {
205        return CDI.current().select(EditCustomerTypeShippingMethodCommand.class).get().run(userVisitPK, form);
206    }
207    
208    @Override
209    public CommandResult<VoidResult> deleteCustomerTypeShippingMethod(UserVisitPK userVisitPK, DeleteCustomerTypeShippingMethodForm form) {
210        return CDI.current().select(DeleteCustomerTypeShippingMethodCommand.class).get().run(userVisitPK, form);
211    }
212    
213}