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.hr.lm.leavecalendar.service;
17  
18  import java.math.BigDecimal;
19  import java.util.Date;
20  
21  import org.kuali.hr.lm.leavecalendar.LeaveCalendarDocument;
22  import org.kuali.hr.time.calendar.CalendarEntries;
23  import org.kuali.rice.kew.api.exception.WorkflowException;
24  
25  public interface LeaveCalendarService {
26      public LeaveCalendarDocument openLeaveCalendarDocument(String principalId, CalendarEntries calEntry) throws WorkflowException;
27      public LeaveCalendarDocument getLeaveCalendarDocument(String documentId);
28      public LeaveCalendarDocument getLeaveCalendarDocument(String principalId, CalendarEntries calendarEntries);
29  
30  
31      boolean isReadyToApprove(LeaveCalendarDocument leaveCalendarDocument);
32  
33      /**
34       * Route the given leaveCalendarDocument
35       * @param principalId
36       * @param leaveCalendarDocument
37       */
38      public void routeLeaveCalendar(String principalId, LeaveCalendarDocument leaveCalendarDocument);
39  
40      public void approveLeaveCalendar(String principalId, LeaveCalendarDocument leaveCalendarDocument);
41  
42      public void disapproveLeaveCalendar(String principalId, LeaveCalendarDocument leaveCalendarDocument);
43      
44      /**
45       * Determine if Leave Calendar document should be created for given principalId and calendar entry
46       * Should only create leave calendar document if active jobs were found with flsa elig = no and ben elg = yes
47       * @param principalId
48       * @param calEntry
49       * @return boolean  
50       */
51      public boolean shouldCreateLeaveDocument(String principalId, CalendarEntries calEntry);
52  
53      /**
54       * Determine if Leave Calendar is planning or reporting calendar
55       * @param principalId
56       * @param beginDate
57       * @param endDate
58       * @return boolean
59       */
60      public boolean isLeavePlanningCalendar(String principalId, Date beginDate, Date endDate);
61      
62      void approveLeaveCalendar(String principalId, LeaveCalendarDocument leaveCalendarDocument, String action);
63  
64      void routeLeaveCalendar(String principalId, LeaveCalendarDocument leaveCalendarDocument, String action);
65  }