1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.kpme.tklm.time.timesheet.service;
17
18 import org.joda.time.DateTime;
19 import org.joda.time.LocalDate;
20 import org.kuali.kpme.core.api.assignment.Assignment;
21 import org.kuali.kpme.core.api.calendar.entry.CalendarEntry;
22 import org.kuali.kpme.core.api.earncode.EarnCode;
23 import org.kuali.kpme.core.api.earncode.EarnCodeContract;
24 import org.kuali.kpme.tklm.api.time.timeblock.TimeBlock;
25 import org.kuali.kpme.tklm.time.timesheet.TimesheetDocument;
26 import org.kuali.rice.kew.api.exception.WorkflowException;
27 import org.springframework.cache.annotation.Cacheable;
28
29 import java.util.List;
30
31 public interface TimesheetService {
32
33
34
35
36
37
38
39 public TimesheetDocument openTimesheetDocument(String principalId, CalendarEntry payCalendarDates) throws WorkflowException;
40
41
42
43
44
45 public void routeTimesheet(String principalId, TimesheetDocument timesheetDocument);
46
47 public void approveTimesheet(String principalId, TimesheetDocument timesheetDocument);
48
49 public void disapproveTimesheet(String principalId, TimesheetDocument timesheetDocument);
50
51
52
53
54
55
56
57
58
59 public TimesheetDocument getTimesheetDocument(String documentId);
60
61
62
63
64 public boolean isSynchronousUser();
65
66
67
68
69
70
71 public List<TimeBlock> getPrevDocumentTimeBlocks(String principalId, DateTime payBeginDate);
72
73
74
75
76
77
78
79 public void loadHolidaysOnTimesheet(TimesheetDocument timesheetDocument, String principalId, LocalDate beginDate, LocalDate endDate);
80
81
82
83
84 public void deleteTimesheet(String documentId);
85
86 public List<TimeBlock> resetTimeBlock(List<TimeBlock> timeBlock, LocalDate asOfDate);
87
88 void approveTimesheet(String principalId, TimesheetDocument timesheetDocument, String action);
89
90 void routeTimesheet(String principalId, TimesheetDocument timesheetDocument, String action);
91 public boolean isReadyToApprove(TimesheetDocument document);
92
93
94
95
96
97
98
99 @Cacheable(value= EarnCodeContract.CACHE_NAME, key="'{getEarnCodesForTime}' + 'principalId=' + T(org.kuali.kpme.tklm.time.util.TkContext).getPrincipalId() + '|' + 'targetId=' + T(org.kuali.kpme.tklm.time.util.TkContext).getTargetPrincipalId() + '|' + 'a=' + #p0.getTkAssignmentId() + '|' + 'asOfDate=' + #p1 + '|' + 'includeRegularEarnCode=' + false")
100 public List<EarnCode> getEarnCodesForTime(Assignment assignment, LocalDate asOfDate);
101
102
103
104
105
106
107
108 @Cacheable(value= EarnCodeContract.CACHE_NAME, key="'{getEarnCodesForTime}' + 'principalId=' + T(org.kuali.kpme.tklm.time.util.TkContext).getPrincipalId() + '|' + 'targetId=' + T(org.kuali.kpme.tklm.time.util.TkContext).getTargetPrincipalId() + '|' + 'a=' + #p0.getTkAssignmentId() + '|' + 'asOfDate=' + #p1 + '|' + 'includeRegularEarnCode=' + #p2")
109 public List<EarnCode> getEarnCodesForTime(Assignment a, LocalDate asOfDate, boolean includeRegularEarnCode);
110
111
112 public List<String> validateTimeBlock(TimesheetDocument td);
113 public List<String> validateHours(TimesheetDocument td);
114 public boolean isTimesheetValid(TimesheetDocument td);
115 }