1 package org.kuali.student.enrollment.class2.courseoffering.service.facade;
2
3 import org.kuali.rice.core.api.util.KeyValue;
4 import org.kuali.student.enrollment.class2.courseoffering.service.facade.issue.CourseOfferingAutogenIssue;
5 import org.kuali.student.enrollment.courseoffering.dto.ActivityOfferingClusterInfo;
6 import org.kuali.student.enrollment.courseoffering.dto.ActivityOfferingInfo;
7 import org.kuali.student.enrollment.courseoffering.dto.CourseOfferingInfo;
8 import org.kuali.student.enrollment.coursewaitlist.dto.CourseWaitListInfo;
9 import org.kuali.student.r2.common.dto.BulkStatusInfo;
10 import org.kuali.student.r2.common.dto.ContextInfo;
11 import org.kuali.student.r2.common.exceptions.AlreadyExistsException;
12 import org.kuali.student.r2.common.exceptions.DataValidationErrorException;
13 import org.kuali.student.r2.common.exceptions.DependentObjectsExistException;
14 import org.kuali.student.r2.common.exceptions.DoesNotExistException;
15 import org.kuali.student.r2.common.exceptions.InvalidParameterException;
16 import org.kuali.student.r2.common.exceptions.MissingParameterException;
17 import org.kuali.student.r2.common.exceptions.OperationFailedException;
18 import org.kuali.student.r2.common.exceptions.PermissionDeniedException;
19 import org.kuali.student.r2.common.exceptions.ReadOnlyException;
20 import org.kuali.student.r2.common.exceptions.VersionMismatchException;
21 import org.kuali.student.r2.core.acal.dto.TermInfo;
22
23 import java.util.HashMap;
24 import java.util.List;
25
26 /**
27 * Used to support service calls related to Autogen RGs.
28 * Terminology
29 * AO: activity offering
30 * FO: format offering
31 * AOC: activity offering cluster
32 * RG: registration group
33 */
34 public interface CourseOfferingServiceFacade {
35
36 /**
37 * Useful for when a cluster is created to create the naming.
38 *
39 * e.g. CL 1, CL 2, CL 3, ...
40 *
41 * @param numberOfExistingClusters used to determine the next name as CL (numberOfExistingClusters+1)
42 * @return the default cluster name for the next cluster.
43 */
44 public String getDefaultClusterName (int numberOfExistingClusters);
45
46 /**
47 * Useful for when a cluster is created to create the naming.
48 *
49 * e.g. CL 1, CL 2, CL 3, ...
50 *
51 * @param courseOfferingId: determines the CourseOffering that a default cluster will be created within
52 * @return the default cluster name for the next cluster.
53 */
54 public String getDefaultClusterNamePerCO (String courseOfferingId, ContextInfo context);
55
56 /**
57 * If a Course Offering is brand-new with no AOs, then call this method to create the first default
58 * AOC to be used.
59 * @param foId The format offering ID that the cluster belongs to
60 * @param context Context info
61 * @return the default cluster created
62 * @throws PermissionDeniedException
63 * @throws MissingParameterException
64 * @throws InvalidParameterException
65 * @throws OperationFailedException
66 * @throws DoesNotExistException
67 * @throws ReadOnlyException
68 * @throws DataValidationErrorException
69 */
70 ActivityOfferingClusterInfo createDefaultCluster(String foId, ContextInfo context)
71 throws PermissionDeniedException, MissingParameterException,
72 InvalidParameterException, OperationFailedException,
73 DoesNotExistException, ReadOnlyException, DataValidationErrorException;
74
75 CourseOfferingInfo copyCourseOfferingToTargetTerm(CourseOfferingInfo coInfo, TermInfo targetTerm, List<String> optionKeys, ContextInfo context) throws InvalidParameterException, PermissionDeniedException, DataValidationErrorException, AlreadyExistsException, ReadOnlyException, OperationFailedException, MissingParameterException, DoesNotExistException
76 ;
77
78 /**
79 * User Story 3: I need the system to automatically create reg groups when I create an AO (via add or copy)
80 * to eliminate the need to manually create them
81 * This creates an AO, then adds the created AO to an AOC, generating RGs as needed
82 * @param aoInfo The AO to be created and added to the AOC
83 * @param aocId The ID of the activity offering cluster
84 * @param context
85 * @return List of RGs created
86 */
87 ActivityOfferingResult createActivityOffering(ActivityOfferingInfo aoInfo, String aocId, ContextInfo context)
88 throws PermissionDeniedException, DataValidationErrorException, InvalidParameterException, ReadOnlyException,
89 OperationFailedException, MissingParameterException, DoesNotExistException, VersionMismatchException;
90
91 /**
92 * A variant on User Story 3 that does not create an AO (relying on copyAO from the
93 * @param aoId The ID of an AO to copy
94 * @param aocId The AOC cluster ID for the copy of the AO to be associated with
95 * @param context
96 * @return An AOResult with RGs created
97 */
98 ActivityOfferingResult copyActivityOfferingToCluster(String aoId, String aocId, ContextInfo context)
99 throws PermissionDeniedException, DataValidationErrorException,
100 InvalidParameterException, ReadOnlyException, OperationFailedException,
101 MissingParameterException, DoesNotExistException, VersionMismatchException;
102
103 /**
104 * User Story 4: I need the system to automatically update registration groups as I
105 * update an activity offering(s) so reg group states and messaging remain current.
106 * @param aoInfo AO to be updated
107 * @param context contextInfo
108 * @return AOResult of RGs modified?
109 */
110 ActivityOfferingResult updateActivityOffering(ActivityOfferingInfo aoInfo, ContextInfo context)
111 throws PermissionDeniedException, DataValidationErrorException, InvalidParameterException, ReadOnlyException,
112 OperationFailedException, MissingParameterException, DoesNotExistException, VersionMismatchException;
113
114 /**
115 * We need an explicit call to update the registration groups.
116 * @param aoInfo AO used and later part of the returned object. This is a pass by reference object so be careful.
117 * @param context contextInfo
118 * @return AOResult of RGs modified?
119 */
120 ActivityOfferingResult updateRegistrationGroups(ActivityOfferingInfo aoInfo, ContextInfo context)
121 throws PermissionDeniedException, DataValidationErrorException, InvalidParameterException, ReadOnlyException,
122 OperationFailedException, MissingParameterException, DoesNotExistException, VersionMismatchException;
123
124 /**
125 * User Story 5: I need the system to automatically delete all associated registration groups when I delete
126 * an AO from an AOC
127 * A pass-through to the deleteActivityOfferingCascaded.
128 * @param aocId
129 * @param foId
130 * @param context
131 * Doesn't return anything for now. If we need something, can always modify the return type
132 */
133 void deleteActivityOfferingCascaded(String aoId, ContextInfo context)
134 throws PermissionDeniedException, MissingParameterException, InvalidParameterException,
135 OperationFailedException, DoesNotExistException, DataValidationErrorException, ReadOnlyException, VersionMismatchException;
136
137 /**
138 * User Story 6: As a user, I need the system to automatically create/delete all associated registration
139 * groups when I move an Activity from one AOC to another
140 * Moves an AO from a source AOC to a target AOC. Assumption is each AO Set in an AOC has a unique AO type,
141 * i.e., no two AO sets within an AOC can have the same type.
142 * @param aoId The id of the AO to be moved from source AOC to target AOC
143 * @param sourceAocId The AOC where aoId is currently (and to be removed)
144 * @param targetAocId The AOC where aoId should be placed
145 * @param context
146 * @return TBD
147 * @throws PermissionDeniedException
148 * @throws MissingParameterException
149 * @throws InvalidParameterException
150 * @throws OperationFailedException
151 * @throws DoesNotExistException
152 */
153 List<BulkStatusInfo> moveActivityOffering(String aoId, String sourceAocId, String targetAocId, ContextInfo context)
154 throws PermissionDeniedException,
155 DataValidationErrorException,
156 DoesNotExistException,
157 InvalidParameterException,
158 MissingParameterException,
159 OperationFailedException,
160 ReadOnlyException,
161 VersionMismatchException;
162
163 /**
164 * User Story 7: As a user, I need the system to automatically delete all AOs when I delete an
165 * AOC so I don’t have to delete all the AOs first
166 * This is a pass-through to service call deleteActivityOfferingClusterCascaded
167 * @param aocId The ID of the AOC to delete
168 *
169 */
170 void deleteActivityOfferingCluster(String aocId, ContextInfo context)
171 throws DoesNotExistException, InvalidParameterException,
172 MissingParameterException, OperationFailedException,
173 PermissionDeniedException, DependentObjectsExistException;
174
175 /**
176 * User Story 8: As a user, I want to view counts of seats so that I can ensure I have the right numbers of seats to support my business needs.
177 *
178 * Compute the maximum number of seats for the Activity Offerings within the given Course Offering specified by courseOfferingId.
179 *
180 * Note: Out of Scope for M6
181 *
182 * @param courseOfferingId
183 * @param contextInfo Context information containing the
184 * principalId and locale information about
185 * the caller of service operation
186 * @return the max number of seats in the Course Offering.
187 * @throws OperationFailedException unable to complete request
188 * @throws PermissionDeniedException an authorization failure has occurred
189 */
190
191 public Integer getSeatCountByCourseOffering (String courseOfferingId, ContextInfo contextInfo) throws OperationFailedException, PermissionDeniedException;
192
193 /**
194 * User Story 8: As a user, I want to view counts of seats so that I can ensure I have the right numbers of seats to support my business needs.
195 *
196 * Compute the maximum number of seats for Activity Offering's within the Activity Offering Cluster specified by aocId.
197 *
198 * Note: Out of Scope for M6
199 *
200 * @param aocId
201 * @param contextInfo Context information containing the
202 * principalId and locale information about
203 * the caller of service operation
204 * @return the max number of seats in the Activity Offering Cluster.
205 * @throws OperationFailedException unable to complete request
206 * @throws PermissionDeniedException an authorization failure has occurred
207 */
208 public Integer getSeatCountByActivityOfferingCluster (String aocId, ContextInfo contextInfo) throws OperationFailedException, PermissionDeniedException;
209
210 /**
211 * User Story 8: As a user, I want to view counts of seats so that I can ensure I have the right numbers of seats to support my business needs.
212 *
213 * Compute the maximum number of seats for Activity Offerings within the Registration Group specified by registrationGroupId.
214 *
215 * Note: Out of Scope for M6
216 *
217 * @param registrationGroupId
218 * @param contextInfo Context information containing the
219 * principalId and locale information about
220 * the caller of service operation
221 * @return the max number of seats in the Registration Group
222 * @throws PermissionDeniedException unable to complete request
223 * @throws OperationFailedException an authorization failure has occurred
224 */
225 public Integer getSeatCountByRegistrationGroup (String registrationGroupId, ContextInfo contextInfo) throws OperationFailedException, PermissionDeniedException;
226
227 public List<CourseOfferingAutogenIssue> findAutogenIssuesByTerm(String termId, ContextInfo context)
228 throws PermissionDeniedException, MissingParameterException, InvalidParameterException,
229 OperationFailedException, DoesNotExistException;
230
231 public CourseOfferingAutogenIssue findAutogenIssuesByCourseOffering(String courseOfferingId, ContextInfo context)
232 throws PermissionDeniedException, MissingParameterException, InvalidParameterException,
233 OperationFailedException, DoesNotExistException;
234
235 /**
236 * User Story 9: As a user, I want to be able to view AOs by Activity, AOC, or Registration Group so that I can view my Activities in a way to support my specific business needs
237 *
238 * Get the counts for the information tool bar at the course offering level.
239 *
240 * @param courseOfferingId
241 * @param context
242 * @return the counts at the course offering level.
243 * @throws OperationFailedException
244 * @throws MissingParameterException
245 * @throws InvalidParameterException
246 * @throws DoesNotExistException
247 * @throws PermissionDeniedException
248 */
249 public AutogenCount getAutogenCountByCourseOffering(String courseOfferingId, ContextInfo context) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException;
250
251 /**
252 * User Story 9: As a user, I want to be able to view AOs by Activity, AOC, or Registration Group so that I can view my Activities in a way to support my specific business needs
253 *
254 * Get the counts for the information toolbar at the format offering level.
255 *
256 * @param formatOfferingId
257 * @param context
258 * @return the counts at the format offering level.
259 *
260 */
261 public AutogenCount getAutogenCountByFormatOffering(String formatOfferingId, ContextInfo context) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException;
262
263
264 /**
265 * User Story 9: As a user, I want to be able to view AOs by Activity, AOC, or Registration Group so that I can view my Activities in a way to support my specific business needs
266 *
267 * Get the counts for the information tool bar at the Activity Offering Cluster Level.
268 *
269 * Note there will always be zero aoc's reported as it is nonsensical at this level.
270 *
271 * @param activiyOfferingClusterId
272 * @param context
273 * @return the counts at the Activity Offering Cluster Level.
274 */
275 public AutogenCount getAutogenCountByActivtyOfferingCluster (String activiyOfferingClusterId, ContextInfo context) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException;
276
277
278 /**
279 * Returns all ActivityOfferingClusterInfos that map back to a single course offering
280 *
281 * @param courseOfferingId
282 * @return
283 */
284 public List<ActivityOfferingClusterInfo> getActivityOfferingClusterByCourseOffering(String courseOfferingId);
285
286 /**
287 * Returns new CourseWaitListInfo after AO had been un-colocated
288 *
289 * @param courseWaitListInfo (original WL)
290 * @param waitlistType
291 * @param hasWaitlist
292 * @param limitWaitlistSize
293 * @param aoId (activity offering ID)
294 * @param foId (format offering ID)
295 * @return
296 */
297 public CourseWaitListInfo createUncolocatedWaitList(CourseWaitListInfo courseWaitListInfo, String waitlistType, boolean hasWaitlist, boolean limitWaitlistSize, String aoId, String foId, ContextInfo context);
298
299 /**
300 * Returns new CourseWaitListInfo after AO had been un-colocated
301 *
302 * @param courseWaitListInfo (original WL)
303 * @param waitlistType
304 * @param hasWaitlist
305 * @param limitWaitlistSize
306 * @param isColocatedAO (activity offering colo or not)
307 * @param isMaxEnrollmentShared (max enrollment shared checked)
308 * @param aoIdfoIdMap (map of ao and fo IDs)
309 * @return
310 */
311 public CourseWaitListInfo createColocatedWaitList(CourseWaitListInfo courseWaitListInfo, String waitlistType, boolean hasWaitlist, boolean limitWaitlistSize, boolean isColocatedAO, boolean isMaxEnrollmentShared,
312 HashMap<String, String> aoIdfoIdMap, ContextInfo context);
313
314
315 /**
316 *
317 * Returns the number of AO Clusters for a particular FO. If there are no clusters, the count will be 0
318 *
319 * @param foId Format Offering Id
320 * @param contextInfo Context Info
321 * @return Returns the number of AO Clusters for a particular FO. If there are no clusters, the count will be 0
322 * @throws MissingParameterException
323 * @throws InvalidParameterException
324 * @throws OperationFailedException
325 * @throws PermissionDeniedException
326 */
327 public int getAoClusterCountByFoId(String foId, ContextInfo contextInfo) throws MissingParameterException,
328 InvalidParameterException,
329 OperationFailedException,
330 PermissionDeniedException;
331
332 /**
333 * This method will give a KeyValue pair AO_ID, AO_TYPE of the Activity Offerings for a given Format offering
334 *
335 * @param foId Format offering Id.
336 * @param contextInfo the context info object
337 * @return List of KeyValue pair AO_ID, AO_TYPE of the Activity Offerings
338 * @throws MissingParameterException
339 * @throws InvalidParameterException
340 * @throws OperationFailedException
341 * @throws PermissionDeniedException
342 */
343 public List<KeyValue> getAoIdAndAoTypeByFO(String foId, ContextInfo contextInfo) throws MissingParameterException,
344 InvalidParameterException,
345 OperationFailedException,
346 PermissionDeniedException;
347 }