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.api.leaveplan;
17  
18  import org.joda.time.DateTime;
19  import org.joda.time.LocalDate;
20  import org.kuali.kpme.core.api.calendar.entry.CalendarEntry;
21  import org.springframework.cache.annotation.Cacheable;
22  
23  import java.util.List;
24  
25  public interface LeavePlanService {
26      
27      /**
28       * Fetch LeavePlan by id
29       * @param lmLeavePlanId
30       * @return
31       */
32      @Cacheable(value= LeavePlanContract.CACHE_NAME, key="'lmLeavePlanId=' + #p0")
33      public LeavePlan getLeavePlan(String lmLeavePlanId);
34  
35      @Cacheable(value= LeavePlanContract.CACHE_NAME, key="'leavePlan=' + #p0 + '|' + 'asOfDate=' + #p1")
36      public LeavePlan getLeavePlan(String leavePlan, LocalDate asOfDate);
37      
38      @Cacheable(value= LeavePlanContract.CACHE_NAME, key="'leavePlans=' + T(org.kuali.rice.core.api.cache.CacheKeyUtils).key(#p0) + '|' + 'asOfDate=' + #p1")
39      public List<LeavePlan> getLeavePlans(List<String> leavePlan, LocalDate asOfDate);
40  
41      public boolean isValidLeavePlan(String leavePlan);
42      
43      public List<LeavePlan> getAllActiveLeavePlan(String leavePlan, LocalDate asOfDate);
44      
45      public List<LeavePlan> getAllInActiveLeavePlan(String leavePlan, LocalDate asOfDate);
46  
47      List<LeavePlan> getLeavePlans(String leavePlan, String calendarYearStart, String descr, String planningMonths,
48                                    LocalDate fromEffdt, LocalDate toEffdt, String active, String showHistory);
49      
50      boolean isFirstCalendarPeriodOfLeavePlan(CalendarEntry calendarEntry, String leavePlan, LocalDate asOfDate);
51      
52      boolean isLastCalendarPeriodOfLeavePlan(CalendarEntry calendarEntry, String leavePlan, LocalDate asOfDate);
53      
54      public List<LeavePlan> getLeavePlansNeedsCarryOverScheduled(int thresholdDays, LocalDate asOfDate);
55  
56      @Cacheable(value= LeavePlanContract.CACHE_NAME, key="'{getFirstDayOfLeavePlan}' + 'leavePlan=' + #p0 + '|' + 'date=' + #p1")
57      public DateTime getFirstDayOfLeavePlan(String leavePlan, LocalDate date);
58  
59      @Cacheable(value= LeavePlanContract.CACHE_NAME, key="'{getRolloverDayOfLeavePlan}' + 'leavePlan=' + #p0 + '|' + 'date=' + #p1")
60      public DateTime getRolloverDayOfLeavePlan(String leavePlan, LocalDate asOfDate);
61  }