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.time.dept.lunch.service;
17
18 import java.sql.Date;
19 import java.util.List;
20
21 import org.kuali.hr.time.dept.lunch.DeptLunchRule;
22 import org.kuali.hr.time.timeblock.TimeBlock;
23 import org.springframework.cache.annotation.Cacheable;
24
25 public interface DepartmentLunchRuleService {
26 /**
27 * Fetch department lunch rule based on criteria passed in
28 * @param dept
29 * @param workArea
30 * @param principalId
31 * @param jobNumber
32 * @param asOfDate
33 * @return
34 */
35 @Cacheable(value= DeptLunchRule.CACHE_NAME,
36 key="'dept=' + #p0" +
37 "+ '|' + 'workArea=' + #p1" +
38 "+ '|' + 'principalId=' + #p2" +
39 "+ '|' + 'jobNumber=' + #p3" +
40 "+ '|' + 'asOfDate=' + #p4")
41 public DeptLunchRule getDepartmentLunchRule(String dept, Long workArea, String principalId, Long jobNumber, Date asOfDate);
42
43 /**
44 * Fetch department lunch rule based on criteria passed in, using literals for wildcards. Will not go through logic to
45 * determine best match, but will match exactly on what is passed in.
46 * @param dept
47 * @param workArea
48 * @param principalId
49 * @param jobNumber
50 * @param asOfDate
51 * @return
52 */
53 @Cacheable(value= DeptLunchRule.CACHE_NAME,
54 key="'{getEarnCodesForLeaveAndTime}'" +
55 "+ 'dept=' + #p0" +
56 "+ '|' + 'workArea=' + #p1" +
57 "+ '|' + 'principalId=' + #p2" +
58 "+ '|' + 'jobNumber=' + #p3" +
59 "+ '|' + 'asOfDate=' + #p4")
60 public DeptLunchRule getDepartmentLunchRuleNoWildCards(String dept, Long workArea, String principalId, Long jobNumber, Date asOfDate);
61 /**
62 * Apply department lunch rule to the list of timeblocks
63 * @param timeblocks
64 */
65 public void applyDepartmentLunchRule(List<TimeBlock> timeblocks);
66
67 /**
68 * Fetch department lunch rule by id
69 * @param tkDeptLunchRuleId
70 * @return
71 */
72 @Cacheable(value= DeptLunchRule.CACHE_NAME, key="'tkDeptLunchRuleId=' + #p0")
73 public DeptLunchRule getDepartmentLunchRule(String tkDeptLunchRuleId);
74
75 List<DeptLunchRule> getDepartmentLunchRules(String dept, String workArea, String principalId, String jobNumber,
76 Date fromEffdt, Date toEffdt, String active, String showHistory);
77 }