View Javadoc

1   /**
2    * Copyright 2004-2012 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.time.earncode.service;
17  
18  import org.kuali.hr.time.assignment.Assignment;
19  import org.kuali.hr.time.earncode.EarnCode;
20  import org.springframework.cache.annotation.Cacheable;
21  
22  import java.math.BigDecimal;
23  import java.sql.Date;
24  import java.util.List;
25  import java.util.Map;
26  
27  public interface EarnCodeService {
28      /**
29       * Fetch a list of earn codes for a particular assignment
30       * @param a
31       * @param asOfDate
32       * @return
33       */
34      @Cacheable(value= EarnCode.CACHE_NAME, key="'a=' + #p0.getTkAssignmentId() + '|' + 'asOfDate=' + #p1")
35      public List<EarnCode> getEarnCodes(Assignment a, Date asOfDate);
36  
37      /**
38       * Fetch a list of earn codes for a particular assignment and earnTypeCode
39       * @param a
40       * @param asOfDate
41       * @return
42       */
43      @Cacheable(value= EarnCode.CACHE_NAME, key="'a=' + #p0.getTkAssignmentId() + '|' + 'asOfDate=' + #p1 + '|' + 'earnTypeCode=' + #p2")
44      public List<EarnCode> getEarnCodes(Assignment a, Date asOfDate, String earnTypeCode);
45  
46      /**
47       * Fetch an EarnCode as of a particular date
48       * @param earnCode
49       * @param asOfDate
50       * @return
51       */
52      @Cacheable(value= EarnCode.CACHE_NAME, key="'earnCode=' + #p0 + '|' + 'asOfDate=' + #p1")
53  	public EarnCode getEarnCode(String earnCode, Date asOfDate);
54  
55      /**
56       * Fetch the earn code type for a particular date
57       * @param earnCode
58       * @param asOfDate
59       * @return
60       */
61      @Cacheable(value= EarnCode.CACHE_NAME, key="'{getEarnCodeType}' + 'earnCode=' + #p0 + '|' + 'asOfDate=' + #p1")
62      String getEarnCodeType(String earnCode, Date asOfDate);
63      
64      /**
65       * Fetch earn code by id
66       * @param earnCodeId
67       * @return
68       */
69      @Cacheable(value= EarnCode.CACHE_NAME, key="'earnCodeId=' + #p0")
70      public EarnCode getEarnCodeById(String earnCodeId);
71      
72      /**
73       * Fetch list of system defined overtime earn codes
74       * @param asOfDate
75       * @return
76       */
77      @Cacheable(value= EarnCode.CACHE_NAME, key="'{getOvertimeEarnCodes}' + 'asOfDate=' + #p0")
78      public List<EarnCode> getOvertimeEarnCodes(Date asOfDate);
79  
80  
81      /**
82       * Fetch list of system defined overtime earn codes as strings
83       * @param asOfDate
84       * @return
85       */
86      @Cacheable(value= EarnCode.CACHE_NAME, key="'{getOvertimeEarnCodesStrs}' + 'asOfDate=' + #p0")
87      public List<String> getOvertimeEarnCodesStrs(Date asOfDate);
88  
89      //make caching by who is looking at this as it is based on that what shows up
90      //@Cacheable(value= EarnCode.CACHE_NAME, key="'a=' + #p0.getTkAssignmentId() + '|' + 'asOfDate=' + #p1")
91      public List<EarnCode> getEarnCodesForTime(Assignment a, Date asOfDate);
92  
93      /**
94  	 * get count of earn code with give earnCode
95  	 * @param earnCode
96  	 * @return int
97  	 */
98      public int getEarnCodeCount(String earnCode);
99  
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 }