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.lm.leavecalendar.service;
017    
018    import java.math.BigDecimal;
019    import java.util.Date;
020    
021    import org.kuali.hr.lm.leavecalendar.LeaveCalendarDocument;
022    import org.kuali.hr.time.calendar.CalendarEntries;
023    import org.kuali.rice.kew.api.exception.WorkflowException;
024    
025    public interface LeaveCalendarService {
026        public LeaveCalendarDocument openLeaveCalendarDocument(String principalId, CalendarEntries calEntry) throws WorkflowException;
027        public LeaveCalendarDocument getLeaveCalendarDocument(String documentId);
028        public LeaveCalendarDocument getLeaveCalendarDocument(String principalId, CalendarEntries calendarEntries);
029    
030    
031        boolean isReadyToApprove(LeaveCalendarDocument leaveCalendarDocument);
032    
033        /**
034         * Route the given leaveCalendarDocument
035         * @param principalId
036         * @param leaveCalendarDocument
037         */
038        public void routeLeaveCalendar(String principalId, LeaveCalendarDocument leaveCalendarDocument);
039    
040        public void approveLeaveCalendar(String principalId, LeaveCalendarDocument leaveCalendarDocument);
041    
042        public void disapproveLeaveCalendar(String principalId, LeaveCalendarDocument leaveCalendarDocument);
043        
044        /**
045         * Determine if Leave Calendar document should be created for given principalId and calendar entry
046         * Should only create leave calendar document if active jobs were found with flsa elig = no and ben elg = yes
047         * @param principalId
048         * @param calEntry
049         * @return boolean  
050         */
051        public boolean shouldCreateLeaveDocument(String principalId, CalendarEntries calEntry);
052    
053        /**
054         * Determine if Leave Calendar is planning or reporting calendar
055         * @param principalId
056         * @param beginDate
057         * @param endDate
058         * @return boolean
059         */
060        public boolean isLeavePlanningCalendar(String principalId, Date beginDate, Date endDate);
061        
062        void approveLeaveCalendar(String principalId, LeaveCalendarDocument leaveCalendarDocument, String action);
063    
064        void routeLeaveCalendar(String principalId, LeaveCalendarDocument leaveCalendarDocument, String action);
065        
066        public BigDecimal getCarryOverForCurrentCalendar(String principalId);
067    }