001// --------------------------------------------------------------------------------
002// Copyright 2002-2025 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.server.command.*;
022import com.echothree.model.data.user.common.pk.UserVisitPK;
023import com.echothree.util.common.command.CommandResult;
024import javax.ejb.Stateless;
025import javax.enterprise.inject.spi.CDI;
026
027@Stateless
028public class CustomerBean
029        extends CustomerFormsImpl
030        implements CustomerRemote, CustomerLocal {
031    
032    // -------------------------------------------------------------------------
033    //   Testing
034    // -------------------------------------------------------------------------
035    
036    @Override
037    public String ping() {
038        return "CustomerBean is alive!";
039    }
040    
041    // -------------------------------------------------------------------------
042    //   Customers
043    // -------------------------------------------------------------------------
044
045    @Override
046    public CommandResult getCustomers(UserVisitPK userVisitPK, GetCustomersForm form) {
047        return CDI.current().select(GetCustomersCommand.class).get().run(userVisitPK, form);
048    }
049
050    @Override
051    public CommandResult getCustomer(UserVisitPK userVisitPK, GetCustomerForm form) {
052        return CDI.current().select(GetCustomerCommand.class).get().run(userVisitPK, form);
053    }
054
055    @Override
056    public CommandResult editCustomer(UserVisitPK userVisitPK, EditCustomerForm form) {
057        return CDI.current().select(EditCustomerCommand.class).get().run(userVisitPK, form);
058    }
059    
060    @Override
061    public CommandResult getCustomerStatusChoices(UserVisitPK userVisitPK, GetCustomerStatusChoicesForm form) {
062        return CDI.current().select(GetCustomerStatusChoicesCommand.class).get().run(userVisitPK, form);
063    }
064    
065    @Override
066    public CommandResult setCustomerStatus(UserVisitPK userVisitPK, SetCustomerStatusForm form) {
067        return CDI.current().select(SetCustomerStatusCommand.class).get().run(userVisitPK, form);
068    }
069    
070    @Override
071    public CommandResult getCustomerCreditStatusChoices(UserVisitPK userVisitPK, GetCustomerCreditStatusChoicesForm form) {
072        return CDI.current().select(GetCustomerCreditStatusChoicesCommand.class).get().run(userVisitPK, form);
073    }
074    
075    @Override
076    public CommandResult setCustomerCreditStatus(UserVisitPK userVisitPK, SetCustomerCreditStatusForm form) {
077        return CDI.current().select(SetCustomerCreditStatusCommand.class).get().run(userVisitPK, form);
078    }
079    
080    // -------------------------------------------------------------------------
081    //   Customer Types
082    // -------------------------------------------------------------------------
083    
084    @Override
085    public CommandResult createCustomerType(UserVisitPK userVisitPK, CreateCustomerTypeForm form) {
086        return CDI.current().select(CreateCustomerTypeCommand.class).get().run(userVisitPK, form);
087    }
088    
089    @Override
090    public CommandResult getCustomerTypes(UserVisitPK userVisitPK, GetCustomerTypesForm form) {
091        return CDI.current().select(GetCustomerTypesCommand.class).get().run(userVisitPK, form);
092    }
093    
094    @Override
095    public CommandResult getCustomerType(UserVisitPK userVisitPK, GetCustomerTypeForm form) {
096        return CDI.current().select(GetCustomerTypeCommand.class).get().run(userVisitPK, form);
097    }
098    
099    @Override
100    public CommandResult getCustomerTypeChoices(UserVisitPK userVisitPK, GetCustomerTypeChoicesForm form) {
101        return CDI.current().select(GetCustomerTypeChoicesCommand.class).get().run(userVisitPK, form);
102    }
103    
104    @Override
105    public CommandResult setDefaultCustomerType(UserVisitPK userVisitPK, SetDefaultCustomerTypeForm form) {
106        return CDI.current().select(SetDefaultCustomerTypeCommand.class).get().run(userVisitPK, form);
107    }
108    
109    @Override
110    public CommandResult editCustomerType(UserVisitPK userVisitPK, EditCustomerTypeForm form) {
111        return CDI.current().select(EditCustomerTypeCommand.class).get().run(userVisitPK, form);
112    }
113    
114    @Override
115    public CommandResult deleteCustomerType(UserVisitPK userVisitPK, DeleteCustomerTypeForm form) {
116        return CDI.current().select(DeleteCustomerTypeCommand.class).get().run(userVisitPK, form);
117    }
118    
119    // -------------------------------------------------------------------------
120    //   Customer Type Descriptions
121    // -------------------------------------------------------------------------
122    
123    @Override
124    public CommandResult createCustomerTypeDescription(UserVisitPK userVisitPK, CreateCustomerTypeDescriptionForm form) {
125        return CDI.current().select(CreateCustomerTypeDescriptionCommand.class).get().run(userVisitPK, form);
126    }
127    
128    @Override
129    public CommandResult getCustomerTypeDescriptions(UserVisitPK userVisitPK, GetCustomerTypeDescriptionsForm form) {
130        return CDI.current().select(GetCustomerTypeDescriptionsCommand.class).get().run(userVisitPK, form);
131    }
132    
133    @Override
134    public CommandResult editCustomerTypeDescription(UserVisitPK userVisitPK, EditCustomerTypeDescriptionForm form) {
135        return CDI.current().select(EditCustomerTypeDescriptionCommand.class).get().run(userVisitPK, form);
136    }
137    
138    @Override
139    public CommandResult deleteCustomerTypeDescription(UserVisitPK userVisitPK, DeleteCustomerTypeDescriptionForm form) {
140        return CDI.current().select(DeleteCustomerTypeDescriptionCommand.class).get().run(userVisitPK, form);
141    }
142    
143    // -------------------------------------------------------------------------
144    //   Customer Type Payment Methods
145    // -------------------------------------------------------------------------
146    
147    @Override
148    public CommandResult createCustomerTypePaymentMethod(UserVisitPK userVisitPK, CreateCustomerTypePaymentMethodForm form) {
149        return CDI.current().select(CreateCustomerTypePaymentMethodCommand.class).get().run(userVisitPK, form);
150    }
151    
152    @Override
153    public CommandResult getCustomerTypePaymentMethod(UserVisitPK userVisitPK, GetCustomerTypePaymentMethodForm form) {
154        return CDI.current().select(GetCustomerTypePaymentMethodCommand.class).get().run(userVisitPK, form);
155    }
156    
157    @Override
158    public CommandResult getCustomerTypePaymentMethods(UserVisitPK userVisitPK, GetCustomerTypePaymentMethodsForm form) {
159        return CDI.current().select(GetCustomerTypePaymentMethodsCommand.class).get().run(userVisitPK, form);
160    }
161    
162    @Override
163    public CommandResult setDefaultCustomerTypePaymentMethod(UserVisitPK userVisitPK, SetDefaultCustomerTypePaymentMethodForm form) {
164        return CDI.current().select(SetDefaultCustomerTypePaymentMethodCommand.class).get().run(userVisitPK, form);
165    }
166    
167    @Override
168    public CommandResult editCustomerTypePaymentMethod(UserVisitPK userVisitPK, EditCustomerTypePaymentMethodForm form) {
169        return CDI.current().select(EditCustomerTypePaymentMethodCommand.class).get().run(userVisitPK, form);
170    }
171    
172    @Override
173    public CommandResult deleteCustomerTypePaymentMethod(UserVisitPK userVisitPK, DeleteCustomerTypePaymentMethodForm form) {
174        return CDI.current().select(DeleteCustomerTypePaymentMethodCommand.class).get().run(userVisitPK, form);
175    }
176    
177    // -------------------------------------------------------------------------
178    //   Customer Type Shipping Methods
179    // -------------------------------------------------------------------------
180    
181    @Override
182    public CommandResult createCustomerTypeShippingMethod(UserVisitPK userVisitPK, CreateCustomerTypeShippingMethodForm form) {
183        return CDI.current().select(CreateCustomerTypeShippingMethodCommand.class).get().run(userVisitPK, form);
184    }
185    
186    @Override
187    public CommandResult getCustomerTypeShippingMethod(UserVisitPK userVisitPK, GetCustomerTypeShippingMethodForm form) {
188        return CDI.current().select(GetCustomerTypeShippingMethodCommand.class).get().run(userVisitPK, form);
189    }
190    
191    @Override
192    public CommandResult getCustomerTypeShippingMethods(UserVisitPK userVisitPK, GetCustomerTypeShippingMethodsForm form) {
193        return CDI.current().select(GetCustomerTypeShippingMethodsCommand.class).get().run(userVisitPK, form);
194    }
195    
196    @Override
197    public CommandResult setDefaultCustomerTypeShippingMethod(UserVisitPK userVisitPK, SetDefaultCustomerTypeShippingMethodForm form) {
198        return CDI.current().select(SetDefaultCustomerTypeShippingMethodCommand.class).get().run(userVisitPK, form);
199    }
200    
201    @Override
202    public CommandResult editCustomerTypeShippingMethod(UserVisitPK userVisitPK, EditCustomerTypeShippingMethodForm form) {
203        return CDI.current().select(EditCustomerTypeShippingMethodCommand.class).get().run(userVisitPK, form);
204    }
205    
206    @Override
207    public CommandResult deleteCustomerTypeShippingMethod(UserVisitPK userVisitPK, DeleteCustomerTypeShippingMethodForm form) {
208        return CDI.current().select(DeleteCustomerTypeShippingMethodCommand.class).get().run(userVisitPK, form);
209    }
210    
211}