View Javadoc

1   /**
2    * Copyright 2004-2013 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.principal.service;
17  
18  import java.util.List;
19  
20  import org.joda.time.LocalDate;
21  import org.kuali.kpme.core.principal.PrincipalHRAttributes;
22  import org.springframework.cache.annotation.Cacheable;
23  
24  public interface PrincipalHRAttributesService {
25  	/**
26  	 * Fetch PrincipalCalendar object at a particular date
27  	 * @param principalId
28  	 * @param asOfDate
29  	 * @return
30  	 */
31      @Cacheable(value= PrincipalHRAttributes.CACHE_NAME, key="'principalId=' + #p0 + '|' + 'asOfDate=' + #p1")
32  	public PrincipalHRAttributes getPrincipalCalendar(String principalId, LocalDate asOfDate);
33  	
34  	/**
35  	 * Get a list of active employees based on pay calendar and as of a particular date 
36  	 * @param payCalendarName
37  	 * @param asOfDate
38  	 * @return
39  	 */
40      @Cacheable(value= PrincipalHRAttributes.CACHE_NAME, key="'payCalendarName=' + #p0 + '|' + 'asOfDate=' + #p1")
41      public List<PrincipalHRAttributes> getActiveEmployeesForPayCalendar(String payCalendarName, LocalDate asOfDate);
42      
43  	/**
44  	 * Get a list of active employees based on leave calendar and as of a particular date 
45  	 * @param leaveCalendarName
46  	 * @param asOfDate
47  	 * @return
48  	 */
49      @Cacheable(value= PrincipalHRAttributes.CACHE_NAME, key="'leaveCalendarName=' + #p0 + '|' + 'asOfDate=' + #p1")
50      public List<PrincipalHRAttributes> getActiveEmployeesForLeaveCalendar(String leaveCalendarName, LocalDate asOfDate);
51      
52      /**
53       * Get a list of unique principal ids that match given criteria, used by leave approval and leave request approval pages
54       * @param leaveCalendarName
55       * @param pidList
56       * @param asOfDate
57       * @return
58       */
59      @Cacheable(value= PrincipalHRAttributes.CACHE_NAME, key="'leaveCalendarName=' + #p0 + '|' + 'asOfDate=' + #p1")
60      public List<String> getActiveEmployeesIdForLeaveCalendarAndIdList(String leaveCalendarName, List<String> pidList, LocalDate asOfDate);
61  	
62      /**
63       * Get a list of unique principal ids that match given criteria, used by Time approval pages
64       * @param timeCalendarName
65       * @param pidList
66       * @param asOfDate
67       * @return
68       */
69      @Cacheable(value= PrincipalHRAttributes.CACHE_NAME, key="'timeCalendarName=' + #p0 + '|' + 'asOfDate=' + #p1")
70      public List<String> getActiveEmployeesIdForTimeCalendarAndIdList(String timeCalendarName, List<String> pidList, LocalDate asOfDate);
71      
72      /**
73  	 * KPME-1250 Kagata
74  	 * Get a list of active employees based on leave plan and as of a particular date 
75  	 * @param leavePlan
76  	 * @param asOfDate
77  	 * @return
78  	 */
79      @Cacheable(value= PrincipalHRAttributes.CACHE_NAME, key="'leavePlan=' + #p0 + '|' + 'asOfDate=' + #p1")
80      public List<PrincipalHRAttributes> getActiveEmployeesForLeavePlan(String leavePlan, LocalDate asOfDate);
81      
82  	/**
83  	 * Fetch inactive PrincipalHRAttributes object at a particular date
84  	 * @param principalId
85  	 * @param asOfDate
86  	 * @return
87  	 */
88      public PrincipalHRAttributes getInactivePrincipalHRAttributes(String principalId, LocalDate asOfDate);
89  	/**
90  	 * Fetch PrincipalHRAttributes object with given id
91  	 * @param hrPrincipalAttributeId
92  	 * @return
93  	 */
94      public PrincipalHRAttributes getPrincipalHRAttributes(String hrPrincipalAttributeId);
95      
96      public List<PrincipalHRAttributes> getAllActivePrincipalHrAttributesForPrincipalId(String principalId, LocalDate asOfDate);
97      
98      public List<PrincipalHRAttributes> getAllInActivePrincipalHrAttributesForPrincipalId(String principalId, LocalDate asOfDate);
99      
100     public PrincipalHRAttributes getMaxTimeStampPrincipalHRAttributes(String principalId);
101     
102     /*
103      * Fetch list of PrincipalHRAttributes that become active for given principalId and date range
104      */
105     @Cacheable(value= PrincipalHRAttributes.CACHE_NAME, key="'{getActivePrincipalHrAttributesForRange}' + 'principalId=' + #p0 + '|' + 'startDate=' + #p1 + '|' + 'startDate=' + #p2")
106     public List<PrincipalHRAttributes> getActivePrincipalHrAttributesForRange(String principalId, LocalDate startDate, LocalDate endDate);
107     /*
108      * Fetch list of PrincipalHRAttributes that become inactive for given principalId and date range
109      */
110     public List<PrincipalHRAttributes> getInactivePrincipalHRAttributesForRange(String principalId, LocalDate startDate, LocalDate endDate);
111     /**
112      * Fetch list of PrincipalHRAttributes using given parameters
113      *
114      * @param principalId
115      * @param leavePlan
116      *@param fromEffdt
117      * @param toEffdt
118      * @param active
119      * @param showHistory     @return
120      */
121     public List<PrincipalHRAttributes> getPrincipalHrAtributes(String userPrincipalId, String principalId, String leavePlan, LocalDate fromEffdt, LocalDate toEffdt, String active, String showHistory);
122 
123     /**
124      * Get List of all active pay calendars for the given principal ids.
125      * @return
126      */
127     public List<String> getUniquePayCalendars(List<String> principalIds);
128     
129     /**
130      * Get List of all active leave calendars for the given principal ids.
131      * @return
132      */
133     public List<String> getUniqueLeaveCalendars(List<String> principalIds);
134     
135 }