View Javadoc

1   /**
2    * Copyright 2004-2012 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.clocklog.service;
17  
18  import java.sql.Timestamp;
19  import java.util.List;
20  
21  import org.kuali.hr.time.assignment.Assignment;
22  import org.kuali.hr.time.calendar.CalendarEntries;
23  import org.kuali.hr.time.clocklog.ClockLog;
24  import org.kuali.hr.time.timesheet.TimesheetDocument;
25  
26  public interface ClockLogService {
27  	/**
28  	 * Save clock log 
29  	 * @param clockLog
30  	 */
31      public void saveClockLog(ClockLog clockLog);
32      /**
33       * Fetch last clock log for principal id
34       * @param principalId
35       * @return
36       */
37      public ClockLog getLastClockLog(String principalId);
38      
39      /**
40       * Fetch last clock log for principal id and clock action
41       * @param principalId
42       * @param clockAction
43       * @return
44       */
45      public ClockLog getLastClockLog(String principalId, String clockAction);
46      /**
47       * Build ClockLog based on criteria passed in
48       * @param clockTimestamp  -- timestamp with grace rule applied if there is one
49       * @param originalTimestamp  -- timestamp without grace rule applied
50       * @param assignment
51       * @param timesheetDocument
52       * @param clockAction
53       * @param ip
54       * @return
55       */
56  	public ClockLog buildClockLog(Timestamp clockTimestamp, Timestamp originalTimestamp, Assignment assignment, TimesheetDocument timesheetDocument, String clockAction, String ip);
57  	
58  	/**
59  	 * Fetch open clock logs by pay calendar entry
60  	 * @param payCalendarEntry
61  	 * @return
62  	 */
63  	public List<ClockLog> getOpenClockLogs(CalendarEntries payCalendarEntry);
64  
65  	/**
66  	 * Process clock log created
67  	 * @param clockTimestamp
68  	 * @param assignment
69  	 * @param pe
70  	 * @param ip
71  	 * @param asOfDate
72  	 * @param td
73  	 * @param clockAction
74  	 * @param principalId
75  	 * @return
76  	 */
77      ClockLog processClockLog(Timestamp clockTimestamp, Assignment assignment, CalendarEntries pe, String ip, java.sql.Date asOfDate, TimesheetDocument td, String clockAction, String principalId);
78      
79      /**
80       * Fetch clock log by id
81       * @param tkClockLogId
82       * @return
83       */
84      public ClockLog getClockLog(String tkClockLogId);
85  
86      ClockLog buildClockLog(Timestamp clockTimestamp, Timestamp originalTimestamp, Assignment assignment, TimesheetDocument timesheetDocument, String clockAction, String ip, String userPrincipalId);
87  
88      ClockLog processClockLog(Timestamp clockTimeStamp, Assignment assignment, CalendarEntries pe, String ip, java.sql.Date asOfDate, TimesheetDocument td, String clockAction, String principalId, String userPrincipalId);
89  }