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