1 /**
2 * Copyright 2004-2014 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.kpme.tklm.time.workflow.service;
17
18 import java.util.List;
19
20 import org.joda.time.DateTime;
21 import org.kuali.kpme.tklm.time.workflow.TimesheetDocumentHeader;
22
23 public interface TimesheetDocumentHeaderService {
24 /**
25 * Save or Update the document header
26 * @param documentHeader
27 */
28 public void saveOrUpdate(TimesheetDocumentHeader documentHeader);
29 /**
30 * Fetch document header for a given document id
31 * @param documentId
32 * @return
33 */
34 public TimesheetDocumentHeader getDocumentHeader(String documentId);
35 /**
36 * Fetch document header for a given principal id and pay period begin date and end date
37 * @param principalId
38 * @param payBeginDate
39 * @param payEndDate
40 * @return
41 */
42 public TimesheetDocumentHeader getDocumentHeader(String principalId, DateTime payBeginDate, DateTime payEndDate);
43 /**
44 * Fetch previous document header
45 * @param principalId
46 * @param payBeginDate
47 * @return
48 */
49 public TimesheetDocumentHeader getPreviousDocumentHeader(String principalId, DateTime payBeginDate);
50 /**
51 * Fetch next document header
52 * @param principalId
53 * @param payBeginDate
54 * @return
55 */
56 public TimesheetDocumentHeader getNextDocumentHeader(String principalId, DateTime payEndDate);
57 /**
58 * Fetch document headers for a given pay period begin date and end date
59 * @param payBeginDate
60 * @param payEndDate
61 * @return
62 */
63 public List<TimesheetDocumentHeader> getDocumentHeaders(DateTime payBeginDate, DateTime payEndDate);
64
65 public void deleteTimesheetHeader(String documentId);
66
67 /**
68 * Fetch list of Document Headers by given principal id
69 * @param principalId
70 * @return List<TimesheetDocumentHeader>
71 */
72 public List<TimesheetDocumentHeader> getDocumentHeadersForPrincipalId(String principalId);
73
74 /**
75 * Fetch list of Document Headers by given principal id and year
76 * @param principalId
77 * @param year
78 * @return List<TimesheetDocumentHeader>
79 */
80 public List<TimesheetDocumentHeader> getDocumentHeadersForYear(String principalId, String year);
81 /*
82 * Fetch the Timesheet document header that contains asOfDate
83 * @param principalId
84 * @param asOfDate
85 * @return TimesheetDocumentHeader
86 */
87 public TimesheetDocumentHeader getDocumentHeaderForDate(String principalId, DateTime asOfDate);
88
89 }