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.kpme.tklm.time.rules.lunch.department.service;
17  
18  import java.util.List;
19  
20  import org.joda.time.LocalDate;
21  import org.kuali.kpme.tklm.time.rules.lunch.department.DeptLunchRule;
22  import org.kuali.kpme.tklm.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, LocalDate 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, LocalDate asOfDate);
61  	 	
62      /**
63  	 * Apply department lunch rule to the list of timeblocks
64  	 * @param timeblocks
65  	 */
66  	public void applyDepartmentLunchRule(List<TimeBlock> timeblocks);
67  	
68  	/**
69  	 * Fetch department lunch rule by id
70  	 * @param tkDeptLunchRuleId
71  	 * @return
72  	 */
73      @Cacheable(value= DeptLunchRule.CACHE_NAME, key="'tkDeptLunchRuleId=' + #p0")
74  	public DeptLunchRule getDepartmentLunchRule(String tkDeptLunchRuleId);
75  
76      List<DeptLunchRule> getDepartmentLunchRules(String userPrincipalId, String dept, String workArea, String principalId, String jobNumber, 
77      											LocalDate fromEffdt, LocalDate toEffdt, String active, String showHistory);
78  }