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