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.leavepayout.service;
17
18 import java.math.BigDecimal;
19 import java.sql.Date;
20 import java.util.List;
21 import java.util.Map;
22 import java.util.Set;
23
24 import org.kuali.hr.lm.leaveSummary.LeaveSummary;
25 import org.kuali.hr.lm.leaveblock.LeaveBlock;
26 import org.kuali.hr.lm.leavecalendar.LeaveCalendarDocument;
27 import org.kuali.hr.lm.leavepayout.LeavePayout;
28 import org.kuali.hr.time.calendar.CalendarEntries;
29 import org.kuali.rice.kew.api.exception.WorkflowException;
30
31 public interface LeavePayoutService {
32
33 public List<LeavePayout> getAllLeavePayoutsForPrincipalId(String principalId);
34 public List<LeavePayout> getAllLeavePayoutsForPrincipalIdAsOfDate(String principalId, Date effectiveDate);
35 public List<LeavePayout> getAllLeavePayoutsByEffectiveDate(Date effectiveDate);
36
37 //@Cacheable(value= LeaveDonation.CACHE_NAME, key="'lmLeavePayoutId=' + #p0")
38 public LeavePayout getLeavePayoutById(String lmLeavePayoutId);
39
40 //Use-Case specific service providers. Could be combined if max carry over applies to all use cases.
41 /**
42 * A service that instantiates and returns LeavePayout objects that follow the given accrual category rule.
43 *
44 * @param principalId The principal this transfer pertains to.
45 * @param accrualCategoryRule The accrual category rule that contains the max balance information.
46 * @param leaveSummary Holds balance information needed for transfer.
47 * @param effectiveDate
48 * @return A LeavePayout object conforming to @param accrualCategoryRule, if one exists. Null otherwise.
49 *
50 * The transfer amount will be the minimum of:
51 *
52 * 1.) the accrual category rule's maximum transfer amount, adjusted for the employees FTE.
53 * 2.) the number of time units exceeding the maximum balance
54 *
55 */
56 public LeavePayout initializePayout(String principalId, String accrualCategoryRule, BigDecimal accruedBalance, Date effectiveDate);
57
58 /**
59 * Consumes a LeavePayout object, creating up to three leave blocks.
60 * @param LeavePayout The LeavePayout object to use for transfer.
61 * @return The same LeavePayout object, but with associated leave block ids.
62 */
63 public LeavePayout payout(LeavePayout leavePayout);
64
65 /**
66 * Helper Services
67 */
68
69 public void submitToWorkflow(LeavePayout leavePayout) throws WorkflowException;
70
71 public List<LeavePayout> getLeavePayouts(String viewPrincipal, Date beginPeriodDate, Date endPeriodDate);
72
73 public void saveOrUpdate(LeavePayout payout);
74
75
76 }