View Javadoc
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.api.time.timeblock;
17  
18  import org.joda.time.DateTime;
19  import org.joda.time.LocalDate;
20  import org.joda.time.LocalTime;
21  import org.kuali.kpme.core.api.block.CalendarBlockContract;
22  import org.kuali.kpme.core.api.mo.UserModified;
23  import org.kuali.kpme.tklm.api.time.timehourdetail.TimeHourDetailContract;
24  
25  import java.math.BigDecimal;
26  import java.util.List;
27  
28  
29  /**
30   * <p>TimeBlockContract interface</p>
31   *
32   */
33  public interface TimeBlockContract extends CalendarBlockContract, UserModified, Comparable<TimeBlockContract> {
34  	
35  
36      /**
37  	 * The beginTimestamp (Time) associated with the TimeBlock
38  	 * 
39  	 * <p>
40  	 * beginTimestamp wrapped in Time object of a TimeBlock
41  	 * <p>
42  	 * 
43  	 * @return new Time(beginTimestamp.getTime()) 
44  	 */
45      public LocalTime getBeginTime();
46     
47      /**
48  	 * The beginTimestamp (Datetime) associated with the TimeBlock
49  	 * 
50  	 * <p>
51  	 * beginTimestamp wrapped in DateTime object of a TimeBlock
52  	 * <p>
53  	 * 
54  	 * @return new DateTime(beginTimestamp)
55  	 */
56      public DateTime getBeginDateTime();
57  
58  
59      /**
60  	 * The endTimestamp (Time) associated with the TimeBlock
61  	 * 
62  	 * <p>
63  	 * endTimestamp wrapped in Time object of a TimeBlock
64  	 * <p>
65  	 * 
66  	 * @return new Time(endTimestamp.getTime()) 
67  	 */
68      public LocalTime getEndTime();
69      
70      /**
71  	 * The endTimestamp (DateTime) associated with the TimeBlock
72  	 * 
73  	 * <p>
74  	 * endTimestamp wrapped in DateTime object of a TimeBlock
75  	 * <p>
76  	 * 
77  	 * @return new DateTime(endTimestamp)
78  	 */
79      public DateTime getEndDateTime();
80     
81      /**
82       * Flag the shows if the timeblock has been created by a clock log
83  	 * 
84  	 * <p>
85  	 * clockLogCreated flag of a Timeblock
86  	 * </p>
87  	 * 
88  	 * @return Y if created, N if not
89  	 */
90      public Boolean isClockLogCreated();
91     
92      /**
93     	 * The hours associated with the TimeBlock
94     	 * 
95     	 * <p>
96     	 * hours of a TimeBlock
97     	 * <p>
98     	 * 
99     	 * @return hours for TimeBlock
100    	 */
101     public BigDecimal getHours();
102 
103     /**
104      * The minutes associated with the TimeBlock (directly related to hours)
105      *
106      * <p>
107      * total minutes of a TimeBlock
108      * <p>
109      *
110      * @return total minutes for TimeBlock
111      */
112     public BigDecimal getTotalMinutes();
113    
114     /**
115    	 * The amount associated with the TimeBlock
116    	 * 
117    	 * <p>
118    	 * amount of a TimeBlock
119    	 * <p>
120    	 * 
121    	 * @return amount for TimeBlock
122    	 */
123     public BigDecimal getAmount();
124 
125     /**
126    	 * The userPrincipalId associated with the TimeBlock
127    	 * 
128    	 * <p>
129    	 * userPrincipalId of a TimeBlock
130    	 * <p>
131    	 * 
132    	 * @return userPrincipalId for TimeBlock
133    	 */
134     public String getUserPrincipalId();
135 
136     /**
137    	 * The timestamp associated with the TimeBlock
138    	 * 
139    	 * <p>
140    	 * timestamp of a TimeBlock
141    	 * <p>
142    	 * 
143    	 * @return timestamp for TimeBlock
144    	 */
145     public DateTime getCreateTime();
146     
147     /**
148 	 * The primary key of a TimeBlock entry saved in a database
149 	 * 
150 	 * <p>
151 	 * tkTimeBlockId of a TimeBlock
152 	 * <p>
153 	 * 
154 	 * @return tkTimeBlockId for TimeBlock
155 	 */
156     public String getTkTimeBlockId();
157    
158     /**
159    	 * The list of TimeHourDetail objects associated with the TimeBlock
160    	 * 
161    	 * <p>
162    	 * timeHourDetails of a TimeBlock
163    	 * <p>
164    	 * 
165    	 * @return timeHourDetails for TimeBlock
166    	 */
167     public List<? extends TimeHourDetailContract> getTimeHourDetails();
168     
169     /**
170 	 * The flag that indicates if the TimeBlock will be pushed back or not
171 	 * 
172 	 * <p>
173 	 * A timeblock will be pushed back if the timeblock is still within the previous interval.
174 	 * </p>
175 	 * 
176 	 * @return Y if pushed back, N if not
177 	 */
178     public Boolean isPushBackward();
179 
180     /**
181    	 * The Timeblock begin time to display with the user's Timezone taken into account and applied to this DateTime object.
182    	 * 
183    	 * <p>
184    	 * Use this call for all GUI/Display related rendering of the END timestamp of the given time block. 
185    	 * Timeblocks require pre-processing before there will be a non-null return value here.
186    	 * <p>
187    	 * 
188    	 * @return beginTimeDisplay for TimeBlock
189    	 */
190     public DateTime getBeginTimeDisplay();
191 
192     /**
193    	 * The Timeblock begin time (Date) associated with the TimeBlock
194    	 * 
195    	 * <p>
196    	 * <p>
197    	 * 
198    	 * @return Date object representing getBeginTimeDisplay()
199    	 */
200     //public DateTime getBeginTimeDisplay();
201 
202     /**
203    	 * The date portion of the Timeblock begin time associated with the TimeBlock
204    	 * 
205    	 * <p>
206    	 * <p>
207    	 * 
208    	 * @return a string representing the getBeginTimeDisplay() in MM/dd/yyyy format
209    	 */
210     public String getBeginTimeDisplayDateOnlyString();
211 
212     /**
213    	 * The time portion of the Timeblock begin time associated with the TimeBlock
214    	 * 
215    	 * <p>
216    	 * <p>
217    	 * 
218    	 * @return a string representing getBeginTimeDisplay() in hh:mm aa format
219    	 */
220     public String getBeginTimeDisplayTimeOnlyString();
221 
222     /**
223    	 * The date portion of the Timeblock end time associated with the TimeBlock
224    	 * 
225    	 * <p>
226    	 * <p>
227    	 * 
228    	 * @return a string representing getEndTimeDisplay() in MM/dd/yyyy format
229    	 */
230     public String getEndTimeDisplayDateOnlyString();
231 
232     /**
233    	 * The time portion of the Timeblock end time associated with the TimeBlock
234    	 * 
235    	 * <p>
236    	 * <p>
237    	 * 
238    	 * @return a string representing the getEndTimeDisplay() in hh:mm aa format
239    	 */
240     public String getEndTimeDisplayTimeOnlyString();
241 
242     /**
243    	 * The Timeblock end time to display with the user's Timezone taken into account and applied to this DateTime object.
244    	 * 
245    	 * <p>
246    	 * Use this call for all GUI/Display related rendering of the END timestamp of the given time block. 
247    	 * Timeblocks require pre-processing before there will be a non-null return value here.
248    	 * <p>
249    	 * 
250    	 * @return endTimeDisplay for TimeBlock
251    	 */
252     public DateTime getEndTimeDisplay();
253 
254     /**
255    	 * The clock log begin id associated with the TimeBlock
256    	 * 
257    	 * <p>
258    	 * clockLogBeginId of a TimeBlock
259    	 * <p>
260    	 * 
261    	 * @return clockLogBeginId for TimeBlock
262    	 */
263     public String getClockLogBeginId();
264 
265     /**
266    	 * The clock log end id associated with the TimeBlock
267    	 * 
268    	 * <p>
269    	 * clockLogEndId of a TimeBlock
270    	 * <p>
271    	 * 
272    	 * @return clockLogEndId for TimeBlock
273    	 */
274     public String getClockLogEndId();
275    
276     /**
277    	 * The assignment key associated with the TimeBlock
278    	 * 
279    	 * <p>
280    	 * assignmentKey of a TimeBlock
281    	 * <p>
282    	 * 
283    	 * @return assignmentKey for TimeBlock
284    	 */
285     public String getAssignmentKey();
286   
287     /**
288    	 * The assignment description associated with the TimeBlock
289    	 * 
290    	 * <p>
291    	 * assignment description of a TimeBlock
292    	 * <p>
293    	 * 
294    	 * @return assignment description for TimeBlock
295    	 */
296     public String getAssignmentDescription();
297    
298     /**
299    	 * The earn code type associated with the TimeBlock
300    	 * 
301    	 * <p>
302    	 * earnCodeType of a TimeBlock
303    	 * <p>
304    	 * 
305    	 * @return earnCodeType for TimeBlock
306    	 */
307     public String getEarnCodeType();
308     
309     /**
310 	 * Indicates if the user has permission to edit/delete the TimeBlock
311 	 * 
312 	 * <p>
313 	 * </p>
314 	 * 
315 	 * @return Y if user has a permission to edit/delete this time block, N if not
316 	 */
317     //public Boolean getEditable();
318 
319     /**
320    	 * The principalId associated with the TimeBlock
321    	 * 
322    	 * <p>
323    	 * principalId of a TimeBlock
324    	 * <p>
325    	 * 
326    	 * @return principalId for TimeBlock
327    	 */
328     public String getPrincipalId();
329    
330     /**
331      * TODO: Put a better comment
332    	 * The overtimePref associated with the TimeBlock
333    	 * 
334    	 * <p>
335    	 * overtimePref of a TimeBlock
336    	 * <p>
337    	 * 
338    	 * @return overtimePref for TimeBlock
339    	 */
340     public String getOvertimePref();
341 
342     /**
343    	 * The actual begin time string associated with the TimeBlock
344    	 * 
345    	 * <p>
346    	 * It applies grace period rule to times of time block.  This string is for GUI of Actual time inquiry
347    	 * <p>
348    	 * 
349    	 * @return actual begin time string for TimeBlock
350    	 */
351     public String getActualBeginTimeString();
352 
353     /**
354    	 * The actual end time string associated with the TimeBlock
355    	 * 
356    	 * <p>
357    	 * It applies grace period rule to times of time block.  This string is for GUI of Actual time inquiry
358    	 * <p>
359    	 * 
360    	 * @return actual end time string for TimeBlock
361    	 */
362     public String getActualEndTimeString();
363 
364 	/**
365 	 * Indicates if this user has a permission to delete this time block
366 	 * 
367 	 * <p>
368 	 * </p>
369 	 * 
370 	 * @return Y if user has a permission to delete this time block, N if not
371 	 */
372 	//public Boolean getDeleteable();
373 
374 	/**
375 	 * Indicates if overtime earn code can be edited
376 	 * 
377 	 * <p>
378 	 * </p>
379 	 * 
380 	 * @return Y if overtime earn code can be edited, N if not
381 	 */
382 	//public Boolean getOvertimeEditable();
383 
384 	/**
385 	 * Indicates if this user has a permission to edit this time block
386 	 * 
387 	 * <p>
388 	 * </p>
389 	 * 
390 	 * @return Y if user has a permission to edit this time block, N if not
391 	 */
392     //public Boolean getTimeBlockEditable();
393 
394     /**
395      * TODO: Make sure this comment is right
396 	 * The flag that indicates if lunch hour is deleted
397 	 * 
398 	 * <p>
399 	 * lunchDeleted flag of a TimeBlock
400 	 * </p>
401 	 * 
402 	 * @return Y if deleted, N if not
403 	 */
404     public boolean isLunchDeleted();
405 
406 	/**
407    	 * The id of the CalendarBlock object associated with the TimeBlock
408    	 * 
409    	 * <p>
410    	 * super.hrCalendarBlockId a TimeBlock
411    	 * <p>
412    	 * 
413    	 * @return super.hrCalendarBlockId for TimeBlock
414    	 */
415 	public String getHrCalendarBlockId();
416 
417     public DateTime getLeaveDateTime();
418 
419     DateTime getActionDateTime();
420     String getClockAction();
421     String getMissedPunchDocId();
422     String getMissedPunchDocStatus();
423     String getAssignmentValue();
424     Boolean isClockedByMissedPunch();
425     boolean isMissedPunchClockIn();
426     boolean isMissedPunchClockOut();
427 
428 }