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.tax.server;
018
019import com.echothree.control.user.tax.common.TaxRemote;
020import com.echothree.control.user.tax.common.form.*;
021import com.echothree.control.user.tax.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 TaxBean
029        extends TaxFormsImpl
030        implements TaxRemote, TaxLocal {
031    
032    // -------------------------------------------------------------------------
033    //   Testing
034    // -------------------------------------------------------------------------
035    
036    @Override
037    public String ping() {
038        return "TaxBean is alive!";
039    }
040    
041    // -------------------------------------------------------------------------
042    //   Tax Classifications
043    // -------------------------------------------------------------------------
044
045    @Override
046    public CommandResult createTaxClassification(UserVisitPK userVisitPK, CreateTaxClassificationForm form) {
047        return CDI.current().select(CreateTaxClassificationCommand.class).get().run(userVisitPK, form);
048    }
049
050    @Override
051    public CommandResult getTaxClassifications(UserVisitPK userVisitPK, GetTaxClassificationsForm form) {
052        return CDI.current().select(GetTaxClassificationsCommand.class).get().run(userVisitPK, form);
053    }
054
055    @Override
056    public CommandResult getTaxClassification(UserVisitPK userVisitPK, GetTaxClassificationForm form) {
057        return CDI.current().select(GetTaxClassificationCommand.class).get().run(userVisitPK, form);
058    }
059
060    @Override
061    public CommandResult getTaxClassificationChoices(UserVisitPK userVisitPK, GetTaxClassificationChoicesForm form) {
062        return CDI.current().select(GetTaxClassificationChoicesCommand.class).get().run(userVisitPK, form);
063    }
064
065    @Override
066    public CommandResult setDefaultTaxClassification(UserVisitPK userVisitPK, SetDefaultTaxClassificationForm form) {
067        return CDI.current().select(SetDefaultTaxClassificationCommand.class).get().run(userVisitPK, form);
068    }
069
070    @Override
071    public CommandResult editTaxClassification(UserVisitPK userVisitPK, EditTaxClassificationForm form) {
072        return CDI.current().select(EditTaxClassificationCommand.class).get().run(userVisitPK, form);
073    }
074
075    @Override
076    public CommandResult deleteTaxClassification(UserVisitPK userVisitPK, DeleteTaxClassificationForm form) {
077        return CDI.current().select(DeleteTaxClassificationCommand.class).get().run(userVisitPK, form);
078    }
079
080    // -------------------------------------------------------------------------
081    //   Tax Classification Translations
082    // -------------------------------------------------------------------------
083
084    @Override
085    public CommandResult createTaxClassificationTranslation(UserVisitPK userVisitPK, CreateTaxClassificationTranslationForm form) {
086        return CDI.current().select(CreateTaxClassificationTranslationCommand.class).get().run(userVisitPK, form);
087    }
088
089    @Override
090    public CommandResult getTaxClassificationTranslations(UserVisitPK userVisitPK, GetTaxClassificationTranslationsForm form) {
091        return CDI.current().select(GetTaxClassificationTranslationsCommand.class).get().run(userVisitPK, form);
092    }
093
094    @Override
095    public CommandResult getTaxClassificationTranslation(UserVisitPK userVisitPK, GetTaxClassificationTranslationForm form) {
096        return CDI.current().select(GetTaxClassificationTranslationCommand.class).get().run(userVisitPK, form);
097    }
098
099    @Override
100    public CommandResult editTaxClassificationTranslation(UserVisitPK userVisitPK, EditTaxClassificationTranslationForm form) {
101        return CDI.current().select(EditTaxClassificationTranslationCommand.class).get().run(userVisitPK, form);
102    }
103
104    @Override
105    public CommandResult deleteTaxClassificationTranslation(UserVisitPK userVisitPK, DeleteTaxClassificationTranslationForm form) {
106        return CDI.current().select(DeleteTaxClassificationTranslationCommand.class).get().run(userVisitPK, form);
107    }
108    
109    // -------------------------------------------------------------------------
110    //   Item Tax Classifications
111    // -------------------------------------------------------------------------
112
113    @Override
114    public CommandResult createItemTaxClassification(UserVisitPK userVisitPK, CreateItemTaxClassificationForm form) {
115        return CDI.current().select(CreateItemTaxClassificationCommand.class).get().run(userVisitPK, form);
116    }
117
118    @Override
119    public CommandResult getItemTaxClassifications(UserVisitPK userVisitPK, GetItemTaxClassificationsForm form) {
120        return CDI.current().select(GetItemTaxClassificationsCommand.class).get().run(userVisitPK, form);
121    }
122
123    @Override
124    public CommandResult getItemTaxClassification(UserVisitPK userVisitPK, GetItemTaxClassificationForm form) {
125        return CDI.current().select(GetItemTaxClassificationCommand.class).get().run(userVisitPK, form);
126    }
127
128    @Override
129    public CommandResult editItemTaxClassification(UserVisitPK userVisitPK, EditItemTaxClassificationForm form) {
130        return CDI.current().select(EditItemTaxClassificationCommand.class).get().run(userVisitPK, form);
131    }
132
133    @Override
134    public CommandResult deleteItemTaxClassification(UserVisitPK userVisitPK, DeleteItemTaxClassificationForm form) {
135        return CDI.current().select(DeleteItemTaxClassificationCommand.class).get().run(userVisitPK, form);
136    }
137
138    // -------------------------------------------------------------------------
139    //   Taxes
140    // -------------------------------------------------------------------------
141    
142    @Override
143    public CommandResult createTax(UserVisitPK userVisitPK, CreateTaxForm form) {
144        return CDI.current().select(CreateTaxCommand.class).get().run(userVisitPK, form);
145    }
146    
147    @Override
148    public CommandResult getTaxes(UserVisitPK userVisitPK, GetTaxesForm form) {
149        return CDI.current().select(GetTaxesCommand.class).get().run(userVisitPK, form);
150    }
151    
152    @Override
153    public CommandResult getTax(UserVisitPK userVisitPK, GetTaxForm form) {
154        return CDI.current().select(GetTaxCommand.class).get().run(userVisitPK, form);
155    }
156    
157    @Override
158    public CommandResult setDefaultTax(UserVisitPK userVisitPK, SetDefaultTaxForm form) {
159        return CDI.current().select(SetDefaultTaxCommand.class).get().run(userVisitPK, form);
160    }
161    
162    @Override
163    public CommandResult editTax(UserVisitPK userVisitPK, EditTaxForm form) {
164        return CDI.current().select(EditTaxCommand.class).get().run(userVisitPK, form);
165    }
166    
167    @Override
168    public CommandResult deleteTax(UserVisitPK userVisitPK, DeleteTaxForm form) {
169        return CDI.current().select(DeleteTaxCommand.class).get().run(userVisitPK, form);
170    }
171    
172    // -------------------------------------------------------------------------
173    //   Tax Descriptions
174    // -------------------------------------------------------------------------
175    
176    @Override
177    public CommandResult createTaxDescription(UserVisitPK userVisitPK, CreateTaxDescriptionForm form) {
178        return CDI.current().select(CreateTaxDescriptionCommand.class).get().run(userVisitPK, form);
179    }
180    
181    @Override
182    public CommandResult getTaxDescriptions(UserVisitPK userVisitPK, GetTaxDescriptionsForm form) {
183        return CDI.current().select(GetTaxDescriptionsCommand.class).get().run(userVisitPK, form);
184    }
185    
186    @Override
187    public CommandResult editTaxDescription(UserVisitPK userVisitPK, EditTaxDescriptionForm form) {
188        return CDI.current().select(EditTaxDescriptionCommand.class).get().run(userVisitPK, form);
189    }
190    
191    @Override
192    public CommandResult deleteTaxDescription(UserVisitPK userVisitPK, DeleteTaxDescriptionForm form) {
193        return CDI.current().select(DeleteTaxDescriptionCommand.class).get().run(userVisitPK, form);
194    }
195    
196    // -------------------------------------------------------------------------
197    //   Geo Code Taxes
198    // -------------------------------------------------------------------------
199    
200    @Override
201    public CommandResult createGeoCodeTax(UserVisitPK userVisitPK, CreateGeoCodeTaxForm form) {
202        return CDI.current().select(CreateGeoCodeTaxCommand.class).get().run(userVisitPK, form);
203    }
204    
205    @Override
206    public CommandResult getGeoCodeTaxes(UserVisitPK userVisitPK, GetGeoCodeTaxesForm form) {
207        return CDI.current().select(GetGeoCodeTaxesCommand.class).get().run(userVisitPK, form);
208    }
209    
210    @Override
211    public CommandResult deleteGeoCodeTax(UserVisitPK userVisitPK, DeleteGeoCodeTaxForm form) {
212        return CDI.current().select(DeleteGeoCodeTaxCommand.class).get().run(userVisitPK, form);
213    }
214    
215}