View Javadoc
1   /**
2    * Copyright 2004-2015 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.tklm.leave.timeoff.service;
17  
18  import java.math.BigDecimal;
19  import java.util.List;
20  
21  import org.joda.time.LocalDate;
22  import org.kuali.kpme.core.assignment.Assignment;
23  import org.kuali.kpme.core.job.Job;
24  import org.kuali.kpme.tklm.leave.timeoff.SystemScheduledTimeOff;
25  import org.kuali.kpme.tklm.time.timesheet.TimesheetDocument;
26  import org.springframework.cache.annotation.Cacheable;
27  
28  public interface SystemScheduledTimeOffService {
29      
30      /**
31       * Fetch SystemScheduledTimeOff by id
32       * @param lmSystemScheduledTimeOffId
33       * @return
34       */
35      @Cacheable(value= SystemScheduledTimeOff.CACHE_NAME, key="'lmSystemScheduledTimeOffId=' + #p0")
36      public SystemScheduledTimeOff getSystemScheduledTimeOff(String lmSystemScheduledTimeOffId);
37      
38      public List<SystemScheduledTimeOff> getSystemScheduledTimeOffForPayPeriod(
39  			String leavePlan, LocalDate startDate, LocalDate endDate);
40  
41  	public SystemScheduledTimeOff getSystemScheduledTimeOffByDate(String leavePlan, LocalDate startDate);
42  
43  	Assignment getAssignmentToApplyHolidays(
44  			TimesheetDocument timesheetDocument, LocalDate payEndDate);
45  
46  	/**
47  	 * Calculate System Scheduled Time Off hours based on given hours and fte of job
48  	 * @param job
49  	 * @param sstoHours
50  	 * @return
51  	 */
52      public BigDecimal calculateSysSchTimeOffHours(Job job, BigDecimal sstoHours);
53  
54      List<SystemScheduledTimeOff> getSystemScheduledTimeOffs(String userPrincipalId, LocalDate fromEffdt, LocalDate toEffdt, String earnCode, LocalDate fromAccruedDate, LocalDate toAccruedDate, 
55      		LocalDate fromSchTimeOffDate, LocalDate toSchTimeOffDate, String active, String showHist);
56      /**
57       * Get the list of all active system scheduled time off for the given leave plan and dates
58       * @param fromEffdt
59       * @param toEffdt
60       * @param fromAccruedDate
61       * @param toAccruedDate
62       * @param leavePlan
63       * @return
64       */
65      public List<SystemScheduledTimeOff> getSystemScheduledTimeOffsForLeavePlan(LocalDate fromAccruedDate,LocalDate toAccruedDate, String leavePlan);
66  
67      /**
68       * 
69       * @param leavePlan
70       * @param localDate
71       * @return Returns the description of the system scheduled time off for the given leave plan and date, or the empty string if no ssto exists.
72       */
73  	public String getSSTODescriptionForDate(String leavePlan, LocalDate localDate);
74  }