001 /** 002 * Copyright 2004-2012 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.time.earncode.service; 017 018 import org.kuali.hr.time.assignment.Assignment; 019 import org.kuali.hr.time.earncode.EarnCode; 020 import org.springframework.cache.annotation.Cacheable; 021 022 import java.math.BigDecimal; 023 import java.sql.Date; 024 import java.util.List; 025 import java.util.Map; 026 027 public interface EarnCodeService { 028 /** 029 * Fetch a list of earn codes for a particular assignment 030 * @param a 031 * @param asOfDate 032 * @return 033 */ 034 @Cacheable(value= EarnCode.CACHE_NAME, key="'a=' + #p0.getTkAssignmentId() + '|' + 'asOfDate=' + #p1") 035 public List<EarnCode> getEarnCodes(Assignment a, Date asOfDate); 036 037 /** 038 * Fetch a list of earn codes for a particular assignment and earnTypeCode 039 * @param a 040 * @param asOfDate 041 * @return 042 */ 043 @Cacheable(value= EarnCode.CACHE_NAME, key="'a=' + #p0.getTkAssignmentId() + '|' + 'asOfDate=' + #p1 + '|' + 'earnTypeCode=' + #p2") 044 public List<EarnCode> getEarnCodes(Assignment a, Date asOfDate, String earnTypeCode); 045 046 /** 047 * Fetch an EarnCode as of a particular date 048 * @param earnCode 049 * @param asOfDate 050 * @return 051 */ 052 @Cacheable(value= EarnCode.CACHE_NAME, key="'earnCode=' + #p0 + '|' + 'asOfDate=' + #p1") 053 public EarnCode getEarnCode(String earnCode, Date asOfDate); 054 055 /** 056 * Fetch the earn code type for a particular date 057 * @param earnCode 058 * @param asOfDate 059 * @return 060 */ 061 @Cacheable(value= EarnCode.CACHE_NAME, key="'{getEarnCodeType}' + 'earnCode=' + #p0 + '|' + 'asOfDate=' + #p1") 062 String getEarnCodeType(String earnCode, Date asOfDate); 063 064 /** 065 * Fetch earn code by id 066 * @param earnCodeId 067 * @return 068 */ 069 @Cacheable(value= EarnCode.CACHE_NAME, key="'earnCodeId=' + #p0") 070 public EarnCode getEarnCodeById(String earnCodeId); 071 072 /** 073 * Fetch list of system defined overtime earn codes 074 * @param asOfDate 075 * @return 076 */ 077 @Cacheable(value= EarnCode.CACHE_NAME, key="'{getOvertimeEarnCodes}' + 'asOfDate=' + #p0") 078 public List<EarnCode> getOvertimeEarnCodes(Date asOfDate); 079 080 081 /** 082 * Fetch list of system defined overtime earn codes as strings 083 * @param asOfDate 084 * @return 085 */ 086 @Cacheable(value= EarnCode.CACHE_NAME, key="'{getOvertimeEarnCodesStrs}' + 'asOfDate=' + #p0") 087 public List<String> getOvertimeEarnCodesStrs(Date asOfDate); 088 089 //make caching by who is looking at this as it is based on that what shows up 090 //@Cacheable(value= EarnCode.CACHE_NAME, key="'a=' + #p0.getTkAssignmentId() + '|' + 'asOfDate=' + #p1") 091 public List<EarnCode> getEarnCodesForTime(Assignment a, Date asOfDate); 092 093 /** 094 * get count of earn code with give earnCode 095 * @param earnCode 096 * @return int 097 */ 098 public int getEarnCodeCount(String earnCode); 099 100 /** 101 * get count of newer version of earn code with give earnCode and date 102 * @param earnCode 103 * @param effdt 104 * @return int 105 */ 106 public int getNewerEarnCodeCount(String earnCode, Date effdt); 107 108 }