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.leavecode.service;
17  
18  import java.math.BigDecimal;
19  import java.sql.Date;
20  import java.util.List;
21  import java.util.Map;
22  
23  import org.kuali.hr.lm.leavecode.LeaveCode;
24  import org.springframework.cache.annotation.Cacheable;
25  
26  public interface LeaveCodeService {
27      
28      /**
29       * Fetch LeaveCode by id
30       * @param lmLeaveCodeId
31       * @return
32       */
33      @Cacheable(value= LeaveCode.CACHE_NAME, key="'lmLeaveCodeId=' + #p0")
34      public LeaveCode getLeaveCode(String lmLeaveCodeId);
35  
36      @Cacheable(value= LeaveCode.CACHE_NAME, key="'principalId=' + #p0 + '|' + 'asOfDate=' + #p1")
37      List<LeaveCode> getLeaveCodes(String principalId, Date asOfDate);
38  
39      @Cacheable(value= LeaveCode.CACHE_NAME, key="'principalId=' + #p0")
40      Map<String, String> getLeaveCodesForDisplay(String principalId);
41  
42      @Cacheable(value= LeaveCode.CACHE_NAME, key="'leaveCode=' + #p0 + '|' + 'effectiveDate=' + #p1")
43      public LeaveCode getLeaveCode(String leaveCode, Date effectiveDate);
44      /**
45  	 * use rounding option and fract time allowed of the given Leave Code to round the given hours
46  	 * @param hours
47  	 * @param leaveCode
48  	 */
49      public BigDecimal roundHrsWithLeaveCode(BigDecimal hours, LeaveCode leaveCode);
50  }