001 /**
002 * Copyright 2004-2013 The Kuali Foundation
003 *
004 * Licensed under the Educational Community 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.opensource.org/licenses/ecl2.php
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 package org.kuali.hr.time.principal.service;
017
018 import java.util.Date;
019 import java.util.List;
020 import org.kuali.hr.time.principal.PrincipalHRAttributes;
021 import org.springframework.cache.annotation.Cacheable;
022
023 public interface PrincipalHRAttributesService {
024 /**
025 * Fetch PrincipalCalendar object at a particular date
026 * @param principalId
027 * @param asOfDate
028 * @return
029 */
030 @Cacheable(value= PrincipalHRAttributes.CACHE_NAME, key="'principalId=' + #p0 + '|' + 'asOfDate=' + #p1")
031 public PrincipalHRAttributes getPrincipalCalendar(String principalId, Date asOfDate);
032
033 /**
034 * Get a list of active employees based on pay calendar and as of a particular date
035 * @param payCalendarName
036 * @param asOfDate
037 * @return
038 */
039 @Cacheable(value= PrincipalHRAttributes.CACHE_NAME, key="'payCalendarName=' + #p0 + '|' + 'asOfDate=' + #p1")
040 public List<PrincipalHRAttributes> getActiveEmployeesForPayCalendar(String payCalendarName, Date asOfDate);
041
042 /**
043 * Get a list of active employees based on leave calendar and as of a particular date
044 * @param leaveCalendarName
045 * @param asOfDate
046 * @return
047 */
048 @Cacheable(value= PrincipalHRAttributes.CACHE_NAME, key="'leaveCalendarName=' + #p0 + '|' + 'asOfDate=' + #p1")
049 public List<PrincipalHRAttributes> getActiveEmployeesForLeaveCalendar(String leaveCalendarName, Date asOfDate);
050
051 /**
052 * Get a list of unique principal ids that match given criteria, used by leave approval and leave request approval pages
053 * @param leaveCalendarName
054 * @param pidList
055 * @param asOfDate
056 * @return
057 */
058 @Cacheable(value= PrincipalHRAttributes.CACHE_NAME, key="'leaveCalendarName=' + #p0 + '|' + 'asOfDate=' + #p1")
059 public List<String> getActiveEmployeesIdForLeaveCalendarAndIdList(String leaveCalendarName, List<String> pidList, Date asOfDate);
060
061 /**
062 * Get a list of unique principal ids that match given criteria, used by Time approval pages
063 * @param timeCalendarName
064 * @param pidList
065 * @param asOfDate
066 * @return
067 */
068 @Cacheable(value= PrincipalHRAttributes.CACHE_NAME, key="'timeCalendarName=' + #p0 + '|' + 'asOfDate=' + #p1")
069 public List<String> getActiveEmployeesIdForTimeCalendarAndIdList(String timeCalendarName, List<String> pidList, Date asOfDate);
070
071 /**
072 * KPME-1250 Kagata
073 * Get a list of active employees based on leave plan and as of a particular date
074 * @param leavePlan
075 * @param asOfDate
076 * @return
077 */
078 @Cacheable(value= PrincipalHRAttributes.CACHE_NAME, key="'leavePlan=' + #p0 + '|' + 'asOfDate=' + #p1")
079 public List<PrincipalHRAttributes> getActiveEmployeesForLeavePlan(String leavePlan, Date asOfDate);
080
081 /**
082 * Fetch inactive PrincipalHRAttributes object at a particular date
083 * @param principalId
084 * @param asOfDate
085 * @return
086 */
087 public PrincipalHRAttributes getInactivePrincipalHRAttributes(String principalId, Date asOfDate);
088 /**
089 * Fetch PrincipalHRAttributes object with given id
090 * @param hrPrincipalAttributeId
091 * @return
092 */
093 public PrincipalHRAttributes getPrincipalHRAttributes(String hrPrincipalAttributeId);
094
095 public List<PrincipalHRAttributes> getAllActivePrincipalHrAttributesForPrincipalId(String principalId, Date asOfDate);
096
097 public List<PrincipalHRAttributes> getAllInActivePrincipalHrAttributesForPrincipalId(String principalId, Date asOfDate);
098
099 public PrincipalHRAttributes getMaxTimeStampPrincipalHRAttributes(String principalId);
100
101 /*
102 * Fetch list of PrincipalHRAttributes that become active for given principalId and date range
103 */
104 public List<PrincipalHRAttributes> getActivePrincipalHrAttributesForRange(String principalId, Date startDate, Date endDate);
105 /*
106 * Fetch list of PrincipalHRAttributes that become inactive for given principalId and date range
107 */
108 public List<PrincipalHRAttributes> getInactivePrincipalHRAttributesForRange(String principalId, Date startDate, Date endDate);
109 /**
110 * Fetch list of PrincipalHRAttributes using given parameters
111 *
112 * @param principalId
113 * @param leavePlan
114 *@param fromEffdt
115 * @param toEffdt
116 * @param active
117 * @param showHistory @return
118 */
119 public List<PrincipalHRAttributes> getPrincipalHrAtributes(String principalId, String leavePlan, java.sql.Date fromEffdt, java.sql.Date toEffdt, String active, String showHistory);
120 /**
121 * Get List of all active pay calendars
122 * @return
123 */
124 public List<String> getUniqueTimePayGroups();
125 }