View Javadoc

1   /**
2    * Copyright 2004-2014 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.overtime.daily.service;
17  
18  import java.util.List;
19  
20  import org.joda.time.LocalDate;
21  import org.kuali.kpme.tklm.time.rules.overtime.daily.DailyOvertimeRule;
22  import org.kuali.kpme.tklm.time.timesheet.TimesheetDocument;
23  import org.kuali.kpme.tklm.time.util.TkTimeBlockAggregate;
24  import org.springframework.cache.annotation.CacheEvict;
25  import org.springframework.cache.annotation.Cacheable;
26  
27  public interface DailyOvertimeRuleService {
28  	/**
29  	 * Save of update a DailyOvertimeRule
30  	 * @param dailyOvertimeRule
31  	 */
32      @CacheEvict(value={DailyOvertimeRule.CACHE_NAME}, allEntries = true)
33  	public void saveOrUpdate(DailyOvertimeRule dailyOvertimeRule);
34  	/**
35  	 * Save or Update a List of DailyOvertimeRules
36  	 * @param dailyOvertimeRules
37  	 */
38      @CacheEvict(value={DailyOvertimeRule.CACHE_NAME}, allEntries = true)
39  	public void saveOrUpdate(List<DailyOvertimeRule> dailyOvertimeRules);
40  	
41  	/**
42  	 * Fetch DailyOvertimeRule for the given criteria
43  	 * @param location
44  	 * @param paytype
45  	 * @param dept
46  	 * @param workArea
47  	 * @param asOfDate
48  	 * @return
49  	 */
50      @Cacheable(value= DailyOvertimeRule.CACHE_NAME,
51              key="'location=' + #p0" +
52                      "+ '|' + 'paytype=' + #p1" +
53                      "+ '|' + 'dept=' + #p2" +
54                      "+ '|' + 'workArea=' + #p3" +
55                      "+ '|' + 'asOfDate=' + #p4")
56  	public DailyOvertimeRule getDailyOvertimeRule(String location, String paytype, String dept, Long workArea, LocalDate asOfDate);
57  	/**
58  	 * Process DailyOvertimeRules for the given TkTimeBlockAggregate
59  	 * @param timesheetDocument
60  	 * @param aggregate
61  	 */
62  	public void processDailyOvertimeRules(TimesheetDocument timesheetDocument, TkTimeBlockAggregate aggregate);
63  	/**
64  	 * Fetch Daily overtime rule by id
65  	 * @param tkDailyOvertimeRuleId
66  	 * @return
67  	 */
68      @Cacheable(value= DailyOvertimeRule.CACHE_NAME, key="'tkDailyOvertimeRuleId=' + #p0")
69  	public DailyOvertimeRule getDailyOvertimeRule(String tkDailyOvertimeRuleId);
70      
71      public List<DailyOvertimeRule> getDailyOvertimeRules(String userPrincipalId, String dept, String workArea, String location, LocalDate fromEffdt, LocalDate toEffdt, String active, String showHist);
72  
73  }