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.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.timeblock.TimeBlock;
25 import org.kuali.hr.time.timesheet.TimesheetDocument;
26
27 public interface ClockLogService {
28 /**
29 * Save clock log
30 * @param clockLog
31 */
32 public ClockLog saveClockLog(ClockLog clockLog);
33 /**
34 * Fetch last clock log for principal id
35 * @param principalId
36 * @return
37 */
38 public ClockLog getLastClockLog(String principalId);
39
40 /**
41 * Fetch last clock log for principal id and clock action
42 * @param principalId
43 * @param clockAction
44 * @return
45 */
46 public ClockLog getLastClockLog(String principalId, String clockAction);
47
48 /**
49 * Fetch last clock log for principal id, assignment details, and calendar entry
50 * @param principalId
51 * @param jobNumber
52 * @param workArea
53 * @param task
54 * @param calendarEntry
55 * @return
56 */
57 public ClockLog getLastClockLog(String principalId, String jobNumber, String workArea, String task, CalendarEntries calendarEntry);
58
59 /**
60 * Process clock log created
61 * @param clockTimestamp
62 * @param assignment
63 * @param pe
64 * @param ip
65 * @param asOfDate
66 * @param td
67 * @param clockAction
68 * @param principalId
69 * @return
70 */
71 ClockLog processClockLog(Timestamp clockTimestamp, Assignment assignment, CalendarEntries pe, String ip, java.sql.Date asOfDate, TimesheetDocument td, String clockAction, boolean runRules, String principalId);
72
73 /**
74 * Fetch clock log by id
75 * @param tkClockLogId
76 * @return
77 */
78 public ClockLog getClockLog(String tkClockLogId);
79
80 ClockLog processClockLog(Timestamp clockTimeStamp, Assignment assignment, CalendarEntries pe, String ip, java.sql.Date asOfDate, TimesheetDocument td, String clockAction, boolean runRules, String principalId, String userPrincipalId);
81
82 public void deleteClockLogsForDocumentId(String documentId);
83
84 /**
85 * Get warning messages for clock actions taken from unapproved IP address on given timesheet document
86 * @param timeBlocks
87 * @return List<String>
88 */
89 public List<String> getUnapprovedIPWarning(List<TimeBlock> timeBlocks);
90
91 /**
92 * Build an unapproved IP address warning message for based on given ClockLog
93 * @param cl
94 * @return
95 */
96 public String buildUnapprovedIPWarning(ClockLog cl);
97 }