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.hr.time.overtime.daily.rule.service;
17  
18  import java.sql.Date;
19  import java.util.List;
20  
21  import org.kuali.hr.time.overtime.daily.rule.DailyOvertimeRule;
22  import org.kuali.hr.time.timesheet.TimesheetDocument;
23  import org.kuali.hr.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, Date 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  }