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.overtime.weekly.service;
17  
18  import java.util.List;
19  
20  import org.joda.time.LocalDate;
21  import org.kuali.kpme.tklm.time.rules.overtime.weekly.WeeklyOvertimeRule;
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 WeeklyOvertimeRuleService {
28  	/**
29  	 * Save or Update a given WeeklyOvertimeRule
30  	 * @param weeklyOvertimeRule
31  	 */
32      @CacheEvict(value={WeeklyOvertimeRule.CACHE_NAME}, allEntries = true)
33  	public void saveOrUpdate(WeeklyOvertimeRule weeklyOvertimeRule);
34  	/**
35  	 * Save or Update a List of WeeklyOvertimeRules
36  	 * @param weeklyOvertimeRules
37  	 */
38      @CacheEvict(value={WeeklyOvertimeRule.CACHE_NAME}, allEntries = true)
39  	public void saveOrUpdate(List<WeeklyOvertimeRule> weeklyOvertimeRules);
40  	/**
41  	 * Fetch a List of WeeklyOvertimeRule as of a particular date
42  	 * @param asOfDate
43  	 * @return
44  	 */
45      @Cacheable(value= WeeklyOvertimeRule.CACHE_NAME, key="'asOfDate=' + #p1")
46  	public List<WeeklyOvertimeRule> getWeeklyOvertimeRules(LocalDate asOfDate);
47  	/**
48  	 * Process weekly overtime rules for a given TkTimeBlockAggregate
49  	 * @param timesheetDocument
50  	 * @param aggregate
51  	 */
52  	public void processWeeklyOvertimeRule(TimesheetDocument timesheetDocument, TkTimeBlockAggregate aggregate);
53  	/**
54  	 * Fetch Weekly overtime rule by id
55  	 * @param tkWeeklyOvertimeRuleId
56  	 * @return
57  	 */
58      @Cacheable(value= WeeklyOvertimeRule.CACHE_NAME, key="'tkWeeklyOvertimeRuleId=' + #p0")
59  	public WeeklyOvertimeRule getWeeklyOvertimeRule(String tkWeeklyOvertimeRuleId);
60  }