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.shipping.server;
018
019import com.echothree.control.user.shipping.common.ShippingRemote;
020import com.echothree.control.user.shipping.common.form.*;
021import com.echothree.control.user.shipping.common.result.*;
022import com.echothree.control.user.shipping.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 ShippingBean
031        extends ShippingFormsImpl
032        implements ShippingRemote, ShippingLocal {
033    
034    // -------------------------------------------------------------------------
035    //   Testing
036    // -------------------------------------------------------------------------
037    
038    @Override
039    public String ping() {
040        return "ShippingBean is alive!";
041    }
042    
043    // -------------------------------------------------------------------------
044    //   Shipping Methods
045    // -------------------------------------------------------------------------
046    
047    @Override
048    public CommandResult<VoidResult> createShippingMethod(UserVisitPK userVisitPK, CreateShippingMethodForm form) {
049        return CDI.current().select(CreateShippingMethodCommand.class).get().run(userVisitPK, form);
050    }
051    
052    @Override
053    public CommandResult<GetShippingMethodResult> getShippingMethod(UserVisitPK userVisitPK, GetShippingMethodForm form) {
054        return CDI.current().select(GetShippingMethodCommand.class).get().run(userVisitPK, form);
055    }
056    
057    @Override
058    public CommandResult<GetShippingMethodsResult> getShippingMethods(UserVisitPK userVisitPK, GetShippingMethodsForm form) {
059        return CDI.current().select(GetShippingMethodsCommand.class).get().run(userVisitPK, form);
060    }
061    
062    @Override
063    public CommandResult<GetShippingMethodChoicesResult> getShippingMethodChoices(UserVisitPK userVisitPK, GetShippingMethodChoicesForm form) {
064        return CDI.current().select(GetShippingMethodChoicesCommand.class).get().run(userVisitPK, form);
065    }
066    
067    @Override
068    public CommandResult<EditShippingMethodResult> editShippingMethod(UserVisitPK userVisitPK, EditShippingMethodForm form) {
069        return CDI.current().select(EditShippingMethodCommand.class).get().run(userVisitPK, form);
070    }
071    
072    @Override
073    public CommandResult<VoidResult> deleteShippingMethod(UserVisitPK userVisitPK, DeleteShippingMethodForm form) {
074        return CDI.current().select(DeleteShippingMethodCommand.class).get().run(userVisitPK, form);
075    }
076    
077    // -------------------------------------------------------------------------
078    //   Shipping Method Descriptions
079    // -------------------------------------------------------------------------
080    
081    @Override
082    public CommandResult<VoidResult> createShippingMethodDescription(UserVisitPK userVisitPK, CreateShippingMethodDescriptionForm form) {
083        return CDI.current().select(CreateShippingMethodDescriptionCommand.class).get().run(userVisitPK, form);
084    }
085    
086    @Override
087    public CommandResult<GetShippingMethodDescriptionResult> getShippingMethodDescription(UserVisitPK userVisitPK, GetShippingMethodDescriptionForm form) {
088        return CDI.current().select(GetShippingMethodDescriptionCommand.class).get().run(userVisitPK, form);
089    }
090
091    @Override
092    public CommandResult<GetShippingMethodDescriptionsResult> getShippingMethodDescriptions(UserVisitPK userVisitPK, GetShippingMethodDescriptionsForm form) {
093        return CDI.current().select(GetShippingMethodDescriptionsCommand.class).get().run(userVisitPK, form);
094    }
095
096    @Override
097    public CommandResult<EditShippingMethodDescriptionResult> editShippingMethodDescription(UserVisitPK userVisitPK, EditShippingMethodDescriptionForm form) {
098        return CDI.current().select(EditShippingMethodDescriptionCommand.class).get().run(userVisitPK, form);
099    }
100    
101    @Override
102    public CommandResult<VoidResult> deleteShippingMethodDescription(UserVisitPK userVisitPK, DeleteShippingMethodDescriptionForm form) {
103        return CDI.current().select(DeleteShippingMethodDescriptionCommand.class).get().run(userVisitPK, form);
104    }
105    
106    // -------------------------------------------------------------------------
107    //   Shipping Method Carrier Services
108    // -------------------------------------------------------------------------
109    
110    @Override
111    public CommandResult<VoidResult> createShippingMethodCarrierService(UserVisitPK userVisitPK, CreateShippingMethodCarrierServiceForm form) {
112        return CDI.current().select(CreateShippingMethodCarrierServiceCommand.class).get().run(userVisitPK, form);
113    }
114    
115    @Override
116    public CommandResult<GetShippingMethodCarrierServiceResult> getShippingMethodCarrierService(UserVisitPK userVisitPK, GetShippingMethodCarrierServiceForm form) {
117        return CDI.current().select(GetShippingMethodCarrierServiceCommand.class).get().run(userVisitPK, form);
118    }
119
120    @Override
121    public CommandResult<GetShippingMethodCarrierServicesResult> getShippingMethodCarrierServices(UserVisitPK userVisitPK, GetShippingMethodCarrierServicesForm form) {
122        return CDI.current().select(GetShippingMethodCarrierServicesCommand.class).get().run(userVisitPK, form);
123    }
124
125    @Override
126    public CommandResult<VoidResult> deleteShippingMethodCarrierService(UserVisitPK userVisitPK, DeleteShippingMethodCarrierServiceForm form) {
127        return CDI.current().select(DeleteShippingMethodCarrierServiceCommand.class).get().run(userVisitPK, form);
128    }
129    
130}