Class Timesheet
java.lang.Object
overit.geocallapp.wfm.core.bl.timesheet.Timesheet
- All Implemented Interfaces:
Serializable,Iterable<BOTask>
Business object representing a timesheet.
It consists of a header
BOTimesheetHeader and a list of related tasks BOTask- Since:
- 9.2
- See Also:
- GCApi:
- bo
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddEventEntity(BOEventEntity toAdd) voidAdds the given task.fallsIntoRange(Date rangeStartDate, Date rangeEndDate) Find the timesheet's task by the given search functiongetActiveOnCallShiftTasks(Long onCallShift) Returns the active tasks of the on call shift.getActiveShiftTasks(Long shift) Returns the active tasks of the shift.Returns the active tasks list.getActiveTasksByIntervention(Long intervention) getActiveTasksByRange(Date rangeStartDate, Date rangeEndDate) Returns the timesheet header.getId()Returns the timesheet id.getOnCallShiftActualEndDate(Long onCallShift) Returns the maximum end date of the tasks of the given on call shift.getOnCallShiftActualStartDate(Long onCallShift) Returns the minumum start date of the tasks of the given on call shift.Returns the on call shift id list of the timesheet tasks.getOnCallShiftTasks(Long onCallShift) Returns the tasks of the on call shift.getShiftActualEndDate(Long shift) Returns the maximum end date of the tasks of the given shift.getShiftActualStartDate(Long shift) Returns the minumum start date of the tasks of the given shift.Returns the shift id list of the timesheet tasks.getShiftTasks(Long shift) Returns the tasks of the shift.getTaskByEndEntity(Long category, Long eventType, BOEventEntity eventEntity) Finds the active task by the given category, end event type and end event entity.getTaskById(Long taskId) Returns the task by the given id.getTaskByStartEntity(Long category, Long eventType, BOEventEntity eventEntity) Finds the active task by the given category, start event type and start event entity.Returns the task category id list of the timesheet tasks.getTasks()Returns the tasks list.Returns the on unavailability reason id list of the timesheet tasks.getWarningById(Long id) getWarningsByTask(Long taskId) booleanincludesDate(Date referenceDate) Checks whether the timesheet includes the specified date.isInterventionTask(Long intervention) isOnCallShiftTask(Long onCallShift) booleanisOpen()Checks whether the timesheet is in open state.isShiftTask(Long shift) booleanChecks whether the timesheet is in to be validated state.booleanChecks whether the timesheet is in validated state.iterator()Returns an iterator on the timesheet tasks list.booleanremoveEventEntity(Long eventEntityId) booleanremoveTask(Long taskId) Remove the given task.voidreplaceEventEntity(BOEventEntity eventEntity) voidreplaceTask(BOTask task) Replace task.voidsetEventEntities(List<BOEventEntity> eventEntities) voidsetHeader(BOTimesheetHeader header) Sets the timesheet header.voidSets the task list.voidsetWarnings(List<BOWarning> warnings) voidsortTasks(Comparator<BOTask> comparator) Sort tasks.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
header
-
tasks
-
warnings
-
eventEntities
-
-
Constructor Details
-
Timesheet
public Timesheet()Instantiates a new timesheet.
-
-
Method Details
-
getHeader
Returns the timesheet header.- Returns:
- the header id
- See Also:
-
setHeader
Sets the timesheet header.- Parameters:
header- the header id- See Also:
-
getId
Returns the timesheet id.- Returns:
- the id of the timesheet header
-
getTasks
Returns the tasks list.- Returns:
- a list of BO task elements of type BOTask
-
setTasks
Sets the task list.- Parameters:
tasks- the task list
-
getActiveTasks
Returns the active tasks list.- Returns:
- a list of active BO task elements of type BOTask
-
getActiveShiftTasks
-
getActiveTasksByRange
-
getTaskById
Returns the task by the given id.- Parameters:
taskId- the task id- Returns:
- the
BOTask
-
addTask
Adds the given task.- Parameters:
toAdd- the task to add
-
removeTask
Remove the given task.- Parameters:
taskId- the task id- Returns:
- true, if successful
-
replaceTask
Replace task.- Parameters:
task- the task
-
sortTasks
Sort tasks.- Parameters:
comparator- the comparator
-
findTask
Find the timesheet's task by the given search function- Parameters:
searchFunction- the search function- Returns:
- the
BOTask
-
iterator
Returns an iterator on the timesheet tasks list. -
isActiveTask
-
fallsIntoRange
-
isShiftTask
-
isOnCallShiftTask
-
isWithoutShiftTask
-
isInterventionTask
-
includesDate
Checks whether the timesheet includes the specified date.- Parameters:
referenceDate- the reference date- Returns:
trueif timesheet interval includes the date,falseotherwise
-
isOpen
public boolean isOpen()Checks whether the timesheet is in open state.- Returns:
trueif timesheet state isBOTimesheetState.Values.OPEN
-
isToBeValidated
public boolean isToBeValidated()Checks whether the timesheet is in to be validated state.- Returns:
trueif timesheet state isBOTimesheetState.Values.TO_BE_VALIDATED
-
isValidated
public boolean isValidated()Checks whether the timesheet is in validated state.- Returns:
trueif timesheet state isBOTimesheetState.Values.VALIDATED
-
getShiftIds
Returns the shift id list of the timesheet tasks.- Returns:
- the list of task shift id
-
getOnCallShiftIds
Returns the on call shift id list of the timesheet tasks.- Returns:
- the list of task on call shift id
-
getTaskCategoryIds
Returns the task category id list of the timesheet tasks.- Returns:
- the list of task category id
-
getShiftTasks
Returns the tasks of the shift.- Parameters:
shift- shift id- Returns:
- the list of the tasks related to the shift
-
getActiveShiftTasks
Returns the active tasks of the shift.- Parameters:
shift- shift id- Returns:
- the list of the active tasks related to the shift
-
getOnCallShiftTasks
Returns the tasks of the on call shift.- Parameters:
onCallShift- on call shift id- Returns:
- the list of the tasks related to the on call shift
-
getActiveOnCallShiftTasks
Returns the active tasks of the on call shift.- Parameters:
onCallShift- on call shift id- Returns:
- the list of the active tasks related to the on call shift
-
getTaskByStartEntity
public Optional<BOTask> getTaskByStartEntity(Long category, Long eventType, BOEventEntity eventEntity) Finds the active task by the given category, start event type and start event entity.- Parameters:
category- category ideventType- start event type ideventEntity- start event entity id- Returns:
- an optional
BOTask
-
getTaskByEndEntity
public Optional<BOTask> getTaskByEndEntity(Long category, Long eventType, BOEventEntity eventEntity) Finds the active task by the given category, end event type and end event entity.- Parameters:
category- category ideventType- end event type ideventEntity- end event entity id- Returns:
- the task by end entity
-
getShiftActualStartDate
Returns the minumum start date of the tasks of the given shift.- Parameters:
shift- the shift id- Returns:
- the actual start date of the shift
-
getShiftActualEndDate
Returns the maximum end date of the tasks of the given shift.- Parameters:
shift- the shift id- Returns:
- the actual end date of the shift
-
getOnCallShiftActualStartDate
Returns the minumum start date of the tasks of the given on call shift.- Parameters:
onCallShift- the on call shift id- Returns:
- the actual start date of the on call shift
-
getOnCallShiftActualEndDate
Returns the maximum end date of the tasks of the given on call shift.- Parameters:
onCallShift- the on call shift id- Returns:
- the actual end date of the on call shift
-
getActiveWithoutShiftTasks
-
getWithoutShiftActualStartDate
-
getWithoutShiftActualEndDate
-
getActiveTasksByIntervention
-
getWarnings
-
setWarnings
-
getWarningById
-
getWarningsByTask
-
getEventEntities
-
setEventEntities
-
getEventEntityById
-
addEventEntity
-
removeEventEntity
-
replaceEventEntity
-