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.leavecode.service; 017 018 import java.math.BigDecimal; 019 import java.sql.Date; 020 import java.util.List; 021 import java.util.Map; 022 023 import org.kuali.hr.lm.leavecode.LeaveCode; 024 import org.springframework.cache.annotation.Cacheable; 025 026 public interface LeaveCodeService { 027 028 /** 029 * Fetch LeaveCode by id 030 * @param lmLeaveCodeId 031 * @return 032 */ 033 @Cacheable(value= LeaveCode.CACHE_NAME, key="'lmLeaveCodeId=' + #p0") 034 public LeaveCode getLeaveCode(String lmLeaveCodeId); 035 036 @Cacheable(value= LeaveCode.CACHE_NAME, key="'principalId=' + #p0 + '|' + 'asOfDate=' + #p1") 037 List<LeaveCode> getLeaveCodes(String principalId, Date asOfDate); 038 039 @Cacheable(value= LeaveCode.CACHE_NAME, key="'principalId=' + #p0") 040 Map<String, String> getLeaveCodesForDisplay(String principalId); 041 042 @Cacheable(value= LeaveCode.CACHE_NAME, key="'leaveCode=' + #p0 + '|' + 'effectiveDate=' + #p1") 043 public LeaveCode getLeaveCode(String leaveCode, Date effectiveDate); 044 /** 045 * use rounding option and fract time allowed of the given Leave Code to round the given hours 046 * @param hours 047 * @param leaveCode 048 */ 049 public BigDecimal roundHrsWithLeaveCode(BigDecimal hours, LeaveCode leaveCode); 050 }