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 * Apply department lunch rule to the list of timeblocks 044 * @param timeblocks 045 */ 046 public void applyDepartmentLunchRule(List<TimeBlock> timeblocks); 047 048 /** 049 * Fetch department lunch rule by id 050 * @param tkDeptLunchRuleId 051 * @return 052 */ 053 @Cacheable(value= DeptLunchRule.CACHE_NAME, key="'tkDeptLunchRuleId=' + #p0") 054 public DeptLunchRule getDepartmentLunchRule(String tkDeptLunchRuleId); 055 056 List<DeptLunchRule> getDepartmentLunchRules(String dept, String workArea, String principalId, String jobNumber, String active); 057 }