001 /**
002 * Copyright 2004-2013 The Kuali Foundation
003 *
004 * Licensed under the Educational Community License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.opensource.org/licenses/ecl2.php
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016 package org.kuali.hr.time.dept.lunch.service;
017
018 import java.sql.Date;
019 import java.util.List;
020
021 import org.kuali.hr.time.dept.lunch.DeptLunchRule;
022 import org.kuali.hr.time.timeblock.TimeBlock;
023 import org.springframework.cache.annotation.Cacheable;
024
025 public interface DepartmentLunchRuleService {
026 /**
027 * Fetch department lunch rule based on criteria passed in
028 * @param dept
029 * @param workArea
030 * @param principalId
031 * @param jobNumber
032 * @param asOfDate
033 * @return
034 */
035 @Cacheable(value= DeptLunchRule.CACHE_NAME,
036 key="'dept=' + #p0" +
037 "+ '|' + 'workArea=' + #p1" +
038 "+ '|' + 'principalId=' + #p2" +
039 "+ '|' + 'jobNumber=' + #p3" +
040 "+ '|' + 'asOfDate=' + #p4")
041 public DeptLunchRule getDepartmentLunchRule(String dept, Long workArea, String principalId, Long jobNumber, Date asOfDate);
042
043 /**
044 * Fetch department lunch rule based on criteria passed in, using literals for wildcards. Will not go through logic to
045 * determine best match, but will match exactly on what is passed in.
046 * @param dept
047 * @param workArea
048 * @param principalId
049 * @param jobNumber
050 * @param asOfDate
051 * @return
052 */
053 @Cacheable(value= DeptLunchRule.CACHE_NAME,
054 key="'{getEarnCodesForLeaveAndTime}'" +
055 "+ 'dept=' + #p0" +
056 "+ '|' + 'workArea=' + #p1" +
057 "+ '|' + 'principalId=' + #p2" +
058 "+ '|' + 'jobNumber=' + #p3" +
059 "+ '|' + 'asOfDate=' + #p4")
060 public DeptLunchRule getDepartmentLunchRuleNoWildCards(String dept, Long workArea, String principalId, Long jobNumber, Date asOfDate);
061 /**
062 * Apply department lunch rule to the list of timeblocks
063 * @param timeblocks
064 */
065 public void applyDepartmentLunchRule(List<TimeBlock> timeblocks);
066
067 /**
068 * Fetch department lunch rule by id
069 * @param tkDeptLunchRuleId
070 * @return
071 */
072 @Cacheable(value= DeptLunchRule.CACHE_NAME, key="'tkDeptLunchRuleId=' + #p0")
073 public DeptLunchRule getDepartmentLunchRule(String tkDeptLunchRuleId);
074
075 List<DeptLunchRule> getDepartmentLunchRules(String dept, String workArea, String principalId, String jobNumber,
076 Date fromEffdt, Date toEffdt, String active, String showHistory);
077 }