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.holidaycalendar.service; 017 018 import java.math.BigDecimal; 019 import java.util.Date; 020 import java.util.List; 021 022 import org.kuali.hr.job.Job; 023 import org.kuali.hr.time.assignment.Assignment; 024 import org.kuali.hr.time.holidaycalendar.HolidayCalendar; 025 import org.kuali.hr.time.holidaycalendar.HolidayCalendarDateEntry; 026 import org.kuali.hr.time.timesheet.TimesheetDocument; 027 import org.springframework.cache.annotation.Cacheable; 028 029 public interface HolidayCalendarService { 030 /** 031 * Fetch holiday calendar group 032 * @param holidayCalendarGroup 033 * @return 034 */ 035 @Cacheable(value= HolidayCalendar.CACHE_NAME, key="'holidayCalendarGroup=' + #p0") 036 public HolidayCalendar getHolidayCalendarByGroup(String holidayCalendarGroup); 037 /** 038 * Fetch List of HolidayCalendarDateEntry for a given pay periods start and end date 039 * @param hrHolidayCalendarId 040 * @param startDate 041 * @param endDate 042 * @return 043 */ 044 045 @Cacheable(value= HolidayCalendar.CACHE_NAME, 046 key="'hrHolidayCalendarId=' + #p0" + 047 "+ '|' + 'startDate=' + #p1" + 048 "+ '|' + 'endDate=' + #p2") 049 public List<HolidayCalendarDateEntry> getHolidayCalendarDateEntriesForPayPeriod(String hrHolidayCalendarId, Date startDate, Date endDate); 050 /** 051 * Fetch a HolidayCalendarDateEntry for a given hrHolidayCalendarId and date 052 * @param hrHolidayCalendarId 053 * @param date 054 * @return 055 */ 056 @Cacheable(value= HolidayCalendar.CACHE_NAME, key="'hrHolidayCalendarId=' + #p0 + '|' + 'startDate=' + #p1") 057 public HolidayCalendarDateEntry getHolidayCalendarDateEntryByDate(String hrHolidayCalendarId, Date startDate); 058 /** 059 * Get Assignment to apply to holidays 060 * @param timesheetDocument 061 * @param payEndDate 062 * @return 063 */ 064 public Assignment getAssignmentToApplyHolidays(TimesheetDocument timesheetDocument, java.sql.Date payEndDate); 065 /** 066 * Calculate the total of holiday hours for a given Job and holiday hours 067 * @param job 068 * @param holidayHours 069 * @return 070 */ 071 public BigDecimal calculateHolidayHours(Job job, BigDecimal holidayHours); 072 }