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.workflow.service;
017
018 import org.kuali.hr.time.workflow.TimesheetDocumentHeader;
019
020 import java.util.Date;
021 import java.util.List;
022
023 public interface TimesheetDocumentHeaderService {
024 /**
025 * Save or Update the document header
026 * @param documentHeader
027 */
028 public void saveOrUpdate(TimesheetDocumentHeader documentHeader);
029 /**
030 * Fetch document header for a given document id
031 * @param documentId
032 * @return
033 */
034 public TimesheetDocumentHeader getDocumentHeader(String documentId);
035 /**
036 * Fetch document header for a given principal id and pay period begin date and end date
037 * @param principalId
038 * @param payBeginDate
039 * @param payEndDate
040 * @return
041 */
042 public TimesheetDocumentHeader getDocumentHeader(String principalId, Date payBeginDate, Date payEndDate);
043 /**
044 * Fetch previous document header
045 * @param principalId
046 * @param payBeginDate
047 * @return
048 */
049 public TimesheetDocumentHeader getPreviousDocumentHeader(String principalId, Date payBeginDate);
050 /**
051 * Fetch next document header
052 * @param principalId
053 * @param payBeginDate
054 * @return
055 */
056 public TimesheetDocumentHeader getNextDocumentHeader(String principalId, Date payEndDate);
057 /**
058 * Fetch previous or next Document Header -- uses the current Document from context.
059 * @param prevOrNext
060 * @param principalId
061 * @return
062 */
063 TimesheetDocumentHeader getPrevOrNextDocumentHeader(String prevOrNext, String principalId);
064 /**
065 * Fetch document headers for a given pay period begin date and end date
066 * @param payBeginDate
067 * @param payEndDate
068 * @return
069 */
070 public List<TimesheetDocumentHeader> getDocumentHeaders(Date payBeginDate, Date payEndDate);
071
072 public void deleteTimesheetHeader(String documentId);
073
074 /**
075 * Fetch list of Document Headers by given principal id
076 * @param principalId
077 * @return List<TimesheetDocumentHeader>
078 */
079 public List<TimesheetDocumentHeader> getDocumentHeadersForPrincipalId(String principalId);
080
081 /**
082 * Fetch list of Document Headers by given principal id and year
083 * @param principalId
084 * @param year
085 * @return List<TimesheetDocumentHeader>
086 */
087 public List<TimesheetDocumentHeader> getDocumentHeadersForYear(String principalId, String year);
088 /*
089 * Fetch the Timesheet document header that contains asOfDate
090 * @param principalId
091 * @param asOfDate
092 * @return TimesheetDocumentHeader
093 */
094 public TimesheetDocumentHeader getDocumentHeaderForDate(String principalId, Date asOfDate);
095
096 }