View Javadoc

1   /**
2    * Copyright 2004-2012 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.shiftdiff.rule.service;
17  
18  import java.sql.Date;
19  import java.util.List;
20  
21  import org.kuali.hr.time.shiftdiff.rule.ShiftDifferentialRule;
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 ShiftDifferentialRuleService {
28  	/**
29  	 * Save or Update List of ShiftDifferentialRule objects
30  	 * @param shiftDifferentialRules
31  	 */
32      @CacheEvict(value={ShiftDifferentialRule.CACHE_NAME}, allEntries = true)
33  	public void saveOrUpdate(List<ShiftDifferentialRule> shiftDifferentialRules);
34  	/**
35  	 * Save or Update a ShiftDifferentialRule object
36  	 * @param shiftDifferentialRule
37  	 */
38      @CacheEvict(value={ShiftDifferentialRule.CACHE_NAME}, allEntries = true)
39  	public void saveOrUpdate(ShiftDifferentialRule shiftDifferentialRule);
40  	/**
41  	 * Fetch a ShiftDifferentialRule object for a given id
42  	 * @param tkShiftDifferentialRuleId
43  	 * @return
44  	 */
45      @Cacheable(value= ShiftDifferentialRule.CACHE_NAME, key="'tkShiftDifferentialRuleId=' + #p0")
46  	public ShiftDifferentialRule getShiftDifferentialRule(String tkShiftDifferentialRuleId);
47  	/**
48  	 * Fetch a given ShiftDifferentialRule based on criteria passed in
49  	 * @param location
50  	 * @param hrSalGroup
51  	 * @param payGrade
52  	 * @param pyCalendarGroup
53  	 * @param asOfDate
54  	 * @return
55  	 */
56      @Cacheable(value= ShiftDifferentialRule.CACHE_NAME,
57              key="'location=' + #p0" +
58                  "+ '|' + 'hrSalGroup=' + #p1" +
59                  "+ '|' + 'payGrade=' + #p2" +
60                  "+ '|' + 'pyCalendarGroup=' + #p3" +
61                  "+ '|' + 'asOfDate=' + #p4")
62  	public List<ShiftDifferentialRule> getShiftDifferentalRules(String location,
63              String hrSalGroup, String payGrade, String pyCalendarGroup, Date asOfDate);
64  	/**
65  	 * Process a given TkTimeBlockAggregate with appropriate shift differential rules
66  	 * @param timesheetDocument
67  	 * @param aggregate
68  	 */
69  	public void processShiftDifferentialRules(TimesheetDocument timesheetDocument, TkTimeBlockAggregate aggregate);
70  
71  }