View Javadoc
1   /**
2    * Copyright 2004-2014 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.kpme.core.assignment.dao;
17  
18  import org.joda.time.LocalDate;
19  import org.kuali.kpme.core.assignment.AssignmentBo;
20  
21  import java.util.List;
22  
23  public interface AssignmentDao {
24  
25  	/**
26  	 * Returns all assignments for the provided principalId that are valid as of
27  	 * the specified payPeriodEndDate.
28  	 *
29  	 * @param principalId
30  	 * @param asOfDate
31  	 * @return
32  	 */
33  	public List<AssignmentBo> findAssignments(String principalId, LocalDate asOfDate);
34  	/**
35  	 * Save or update the given assignment
36  	 * @param assignment
37  	 */
38  	public void saveOrUpdate(AssignmentBo assignment);
39  	/**
40  	 * Save of update the given list of assignments
41  	 * @param assignments
42  	 */
43  	public void saveOrUpdate(List<AssignmentBo> assignments);
44  
45  	/**
46  	 * Delete an assignment
47  	 * @param assignment
48  	 */
49  	public void delete(AssignmentBo assignment);
50  
51  	/**
52  	 * Get list of active assignments in a given work area as of a particular date
53  	 * @param workArea
54  	 * @param asOfDate
55  	 * @return
56  	 */
57  	public List<AssignmentBo> getActiveAssignmentsInWorkArea(Long workArea, LocalDate asOfDate);
58  
59      public List<AssignmentBo> getActiveAssignmentsInWorkAreas(List<Long> workAreas, LocalDate asOfDate);
60  
61  	public AssignmentBo getAssignment(String tkAssignmentId);
62  
63      public AssignmentBo getAssignmentForTargetPrincipal(String groupKeyCode, Long job, Long workArea, Long task, LocalDate asOfDate);
64  
65  	public List<AssignmentBo> getActiveAssignments(LocalDate asOfDate);
66  	
67  	public AssignmentBo getAssignment(String principalId, String groupKeyCode, Long jobNumber, Long workArea, Long task, LocalDate asOfDate);
68  	
69  	/**
70  	 * KPME-1129
71  	 * Get a list of active assignments based on principalId and jobNumber as of a particular date 
72  	 * @param principalId
73  	 * @param jobNumber
74  	 * @param asOfDate
75  	 * @return
76  	 */
77  	public List<AssignmentBo> getActiveAssignmentsForJob(String principalId, Long jobNumber, LocalDate asOfDate);
78  
79      List<AssignmentBo> findAssignmentsWithinPeriod(String principalId, LocalDate startDate, LocalDate endDate);
80  
81      public AssignmentBo getMaxTimestampAssignment(String principalId);
82      
83      public List<String> getPrincipalIds(List<String> workAreaList, LocalDate effdt, LocalDate startDate, LocalDate endDate);
84      
85      public List<AssignmentBo> getAssignments(List<String> workAreaList, LocalDate effdt, LocalDate startDate, LocalDate endDate);
86  
87      public List<AssignmentBo> findAssignmentsHistoryForPeriod(String principalId, LocalDate startDate, LocalDate endDate);
88  
89      public List<AssignmentBo> findAssignmentsWithinPeriod(String principalId, LocalDate startDate, LocalDate endDate, boolean requireActive);
90  }
91