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.associate.server;
018
019import com.echothree.control.user.associate.common.AssociateRemote;
020import com.echothree.control.user.associate.common.form.*;
021import com.echothree.control.user.associate.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 AssociateBean
029        extends AssociateFormsImpl
030        implements AssociateRemote, AssociateLocal {
031    
032    // -------------------------------------------------------------------------
033    //   Testing
034    // -------------------------------------------------------------------------
035    
036    @Override
037    public String ping() {
038        return "AssociateBean is alive!";
039    }
040    
041    // -------------------------------------------------------------------------
042    //   Associate Programs
043    // -------------------------------------------------------------------------
044    
045    @Override
046    public CommandResult createAssociateProgram(UserVisitPK userVisitPK, CreateAssociateProgramForm form) {
047        return CDI.current().select(CreateAssociateProgramCommand.class).get().run(userVisitPK, form);
048    }
049    
050    @Override
051    public CommandResult getAssociateProgram(UserVisitPK userVisitPK, GetAssociateProgramForm form) {
052        return CDI.current().select(GetAssociateProgramCommand.class).get().run(userVisitPK, form);
053    }
054    
055    @Override
056    public CommandResult getAssociatePrograms(UserVisitPK userVisitPK, GetAssociateProgramsForm form) {
057        return CDI.current().select(GetAssociateProgramsCommand.class).get().run(userVisitPK, form);
058    }
059    
060    @Override
061    public CommandResult getAssociateProgramChoices(UserVisitPK userVisitPK, GetAssociateProgramChoicesForm form) {
062        return CDI.current().select(GetAssociateProgramChoicesCommand.class).get().run(userVisitPK, form);
063    }
064    
065    @Override
066    public CommandResult setDefaultAssociateProgram(UserVisitPK userVisitPK, SetDefaultAssociateProgramForm form) {
067        return CDI.current().select(SetDefaultAssociateProgramCommand.class).get().run(userVisitPK, form);
068    }
069    
070    @Override
071    public CommandResult editAssociateProgram(UserVisitPK userVisitPK, EditAssociateProgramForm form) {
072        return CDI.current().select(EditAssociateProgramCommand.class).get().run(userVisitPK, form);
073    }
074    
075    @Override
076    public CommandResult deleteAssociateProgram(UserVisitPK userVisitPK, DeleteAssociateProgramForm form) {
077        return CDI.current().select(DeleteAssociateProgramCommand.class).get().run(userVisitPK, form);
078    }
079    
080    // -------------------------------------------------------------------------
081    //   Associate Program Descriptions
082    // -------------------------------------------------------------------------
083    
084    @Override
085    public CommandResult createAssociateProgramDescription(UserVisitPK userVisitPK, CreateAssociateProgramDescriptionForm form) {
086        return CDI.current().select(CreateAssociateProgramDescriptionCommand.class).get().run(userVisitPK, form);
087    }
088    
089    @Override
090    public CommandResult getAssociateProgramDescriptions(UserVisitPK userVisitPK, GetAssociateProgramDescriptionsForm form) {
091        return CDI.current().select(GetAssociateProgramDescriptionsCommand.class).get().run(userVisitPK, form);
092    }
093    
094    @Override
095    public CommandResult editAssociateProgramDescription(UserVisitPK userVisitPK, EditAssociateProgramDescriptionForm form) {
096        return CDI.current().select(EditAssociateProgramDescriptionCommand.class).get().run(userVisitPK, form);
097    }
098    
099    @Override
100    public CommandResult deleteAssociateProgramDescription(UserVisitPK userVisitPK, DeleteAssociateProgramDescriptionForm form) {
101        return CDI.current().select(DeleteAssociateProgramDescriptionCommand.class).get().run(userVisitPK, form);
102    }
103    
104    // -------------------------------------------------------------------------
105    //   Associates
106    // -------------------------------------------------------------------------
107    
108    @Override
109    public CommandResult createAssociate(UserVisitPK userVisitPK, CreateAssociateForm form) {
110        return CDI.current().select(CreateAssociateCommand.class).get().run(userVisitPK, form);
111    }
112    
113    @Override
114    public CommandResult getAssociate(UserVisitPK userVisitPK, GetAssociateForm form) {
115        return CDI.current().select(GetAssociateCommand.class).get().run(userVisitPK, form);
116    }
117    
118    @Override
119    public CommandResult getAssociates(UserVisitPK userVisitPK, GetAssociatesForm form) {
120        return CDI.current().select(GetAssociatesCommand.class).get().run(userVisitPK, form);
121    }
122    
123    @Override
124    public CommandResult getAssociateChoices(UserVisitPK userVisitPK, GetAssociateChoicesForm form) {
125        return CDI.current().select(GetAssociateChoicesCommand.class).get().run(userVisitPK, form);
126    }
127    
128    @Override
129    public CommandResult deleteAssociate(UserVisitPK userVisitPK, DeleteAssociateForm form) {
130        return CDI.current().select(DeleteAssociateCommand.class).get().run(userVisitPK, form);
131    }
132    
133    // -------------------------------------------------------------------------
134    //   Associate Contact Mechanisms
135    // -------------------------------------------------------------------------
136    
137    @Override
138    public CommandResult createAssociatePartyContactMechanism(UserVisitPK userVisitPK, CreateAssociatePartyContactMechanismForm form) {
139        return CDI.current().select(CreateAssociatePartyContactMechanismCommand.class).get().run(userVisitPK, form);
140    }
141    
142    @Override
143    public CommandResult getAssociatePartyContactMechanism(UserVisitPK userVisitPK, GetAssociatePartyContactMechanismForm form) {
144        return CDI.current().select(GetAssociatePartyContactMechanismCommand.class).get().run(userVisitPK, form);
145    }
146    
147    @Override
148    public CommandResult getAssociatePartyContactMechanisms(UserVisitPK userVisitPK, GetAssociatePartyContactMechanismsForm form) {
149        return CDI.current().select(GetAssociatePartyContactMechanismsCommand.class).get().run(userVisitPK, form);
150    }
151    
152    @Override
153    public CommandResult getAssociatePartyContactMechanismChoices(UserVisitPK userVisitPK, GetAssociatePartyContactMechanismChoicesForm form) {
154        return CDI.current().select(GetAssociatePartyContactMechanismChoicesCommand.class).get().run(userVisitPK, form);
155    }
156    
157    @Override
158    public CommandResult setDefaultAssociatePartyContactMechanism(UserVisitPK userVisitPK, SetDefaultAssociatePartyContactMechanismForm form) {
159        return CDI.current().select(SetDefaultAssociatePartyContactMechanismCommand.class).get().run(userVisitPK, form);
160    }
161    
162    @Override
163    public CommandResult deleteAssociatePartyContactMechanism(UserVisitPK userVisitPK, DeleteAssociatePartyContactMechanismForm form) {
164        return CDI.current().select(DeleteAssociatePartyContactMechanismCommand.class).get().run(userVisitPK, form);
165    }
166    
167    // -------------------------------------------------------------------------
168    //   Associate Referrals
169    // -------------------------------------------------------------------------
170    
171    @Override
172    public CommandResult getAssociateReferral(UserVisitPK userVisitPK, GetAssociateReferralForm form) {
173        return CDI.current().select(GetAssociateReferralCommand.class).get().run(userVisitPK, form);
174    }
175    
176    @Override
177    public CommandResult getAssociateReferrals(UserVisitPK userVisitPK, GetAssociateReferralsForm form) {
178        return CDI.current().select(GetAssociateReferralsCommand.class).get().run(userVisitPK, form);
179    }
180    
181    @Override
182    public CommandResult deleteAssociateReferral(UserVisitPK userVisitPK, DeleteAssociateReferralForm form) {
183        return CDI.current().select(DeleteAssociateReferralCommand.class).get().run(userVisitPK, form);
184    }
185    
186}