001 /** 002 * Copyright 2004-2012 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 previous or next Document Header -- uses the current Document from context. 052 * @param prevOrNext 053 * @param principalId 054 * @return 055 */ 056 TimesheetDocumentHeader getPrevOrNextDocumentHeader(String prevOrNext, String principalId); 057 058 public List<TimesheetDocumentHeader> getDocumentHeaders(Date payBeginDate); 059 060 public void deleteTimesheetHeader(String documentId); 061 062 /** 063 * Fetch list of Document Headers by given principal id 064 * @param principalId 065 * @return List<TimesheetDocumentHeader> 066 */ 067 public List<TimesheetDocumentHeader> getDocumentHeadersForPrincipalId(String principalId); 068 069 /** 070 * Fetch list of Document Headers by given principal id and year 071 * @param principalId 072 * @param year 073 * @return List<TimesheetDocumentHeader> 074 */ 075 public List<TimesheetDocumentHeader> getDocumentHeadersForYear(String principalId, String year); 076 /* 077 * Fetch the Timesheet document header that contains asOfDate 078 * @param principalId 079 * @param asOfDate 080 * @return TimesheetDocumentHeader 081 */ 082 public TimesheetDocumentHeader getDocumentHeaderForDate(String principalId, Date asOfDate); 083 084 085 }