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.hr.time.holidaycalendar.service;
17  
18  import java.math.BigDecimal;
19  import java.util.Date;
20  import java.util.List;
21  
22  import org.kuali.hr.job.Job;
23  import org.kuali.hr.time.assignment.Assignment;
24  import org.kuali.hr.time.holidaycalendar.HolidayCalendar;
25  import org.kuali.hr.time.holidaycalendar.HolidayCalendarDateEntry;
26  import org.kuali.hr.time.timesheet.TimesheetDocument;
27  import org.springframework.cache.annotation.Cacheable;
28  
29  public interface HolidayCalendarService {
30  	/**
31  	 * Fetch holiday calendar group
32  	 * @param holidayCalendarGroup
33  	 * @return
34  	 */
35      @Cacheable(value= HolidayCalendar.CACHE_NAME, key="'holidayCalendarGroup=' + #p0")
36  	public HolidayCalendar getHolidayCalendarByGroup(String holidayCalendarGroup);
37  	/**
38  	 * Fetch List of HolidayCalendarDateEntry for a given pay periods start and end date
39  	 * @param hrHolidayCalendarId
40  	 * @param startDate
41  	 * @param endDate
42  	 * @return
43  	 */
44  
45      @Cacheable(value= HolidayCalendar.CACHE_NAME,
46              key="'hrHolidayCalendarId=' + #p0" +
47                      "+ '|' + 'startDate=' + #p1" +
48                      "+ '|' + 'endDate=' + #p2")
49  	public List<HolidayCalendarDateEntry> getHolidayCalendarDateEntriesForPayPeriod(String hrHolidayCalendarId, Date startDate, Date endDate);
50  	/**
51  	 * Fetch a HolidayCalendarDateEntry for a given hrHolidayCalendarId and date
52  	 * @param hrHolidayCalendarId
53  	 * @param date
54  	 * @return
55  	 */
56      @Cacheable(value= HolidayCalendar.CACHE_NAME, key="'hrHolidayCalendarId=' + #p0 + '|' + 'startDate=' + #p1")
57  	public HolidayCalendarDateEntry getHolidayCalendarDateEntryByDate(String hrHolidayCalendarId, Date startDate);
58  	/**
59  	 * Get Assignment to apply to holidays
60  	 * @param timesheetDocument
61  	 * @param payEndDate
62  	 * @return
63  	 */
64  	public Assignment getAssignmentToApplyHolidays(TimesheetDocument timesheetDocument, java.sql.Date payEndDate);
65  	/**
66  	 * Calculate the total of holiday hours for a given Job and holiday hours
67  	 * @param job
68  	 * @param holidayHours
69  	 * @return
70  	 */
71  	public BigDecimal calculateHolidayHours(Job job, BigDecimal holidayHours);
72  }