The data module provides functions for verifying project data such as whether certain records exist or if they are allowed to be modified

Classes

LoadCheck

Methods

FunctionParametersReturn ValueDescription
LoadCheck.__init__(self, planta_id)planta_id: UUID of the load recordNone
LoadCheck.check_booking_is_cancelled(self)
NoneCheck if booking is cancelled and, if so, raise BookingCancelledException.
LoadCheck.check_deadline_for_modification(self)
NoneVerifies whether the booking would violate the deadline. If automatic posting cancelation is not enabled for bookings past the deadline, this raises a DeadlineException.
LoadCheck.check_interface_lock(self)
NoneVerifies whether the booking is locked by the interface. If automatic posting cancelation is not enabled for bookings locked by the interface, this raises a subclass of WebInterfaceException.
LoadCheck.check_modification(self)
NoneVerifies whether the booking is allowed to be modified by invoking all other methods of this class, which in turn raise a subclass of WebInterfaceException if not allowed.
LoadCheck.check_project_or_task_are_finished(self)
NoneVerifies whether the bookings task or project are finished. If automatic posting cancelation is not enabled for bookings on finished tasks or project, this raises a TaskFinishedException or ProjectFinishedException, respectively.
LoadCheck.check_released(self)
NoneVerifies whether the booking is released. If automatic posting cancelation is not enabled for released bookings, this raises a subclass of ReleasedException.

Functions

FunctionParametersReturn ValueDescription
check_date_against_posting_type(project_id, date)project_id: ID of the project (DI001001)
date: java Date object
True if allowed, False otherwiseChecks whether the posting type allows bookings on this date
check_deadline(date=None)date: java Date objectNoneVerifies whether the booking would violate the deadline. If automatic posting cancelation is not enabled for bookings past the deadline, this raises a DeadlineException
check_if_booking_is_possible(project_id, task_id, date)project_id: ID of the project (DI001001)
task_id: ID of the task (DI001098)
date: java Date object
FalseCheck if creating a booking for the given parameters is possible

Raises a subclass of WebInterfaceException if not
check_load_creation(project_id, task_id, resource_id, date, load, load_id=None)project_id: ID of the project (DI001001)
task_id: ID of the task (DI001098)
resource_id: ID of the resource (DI001218)
date: java Date object
load: load value (float)

load_id: UUID of the load record
NoneCheck if a load may be created with the given data

Raises a subclass of WebInterfaceException if we may not create a load
check_load_modification(planta_id)planta_id: UUID of the load recordNoneCheck if a load may be modified with the given data

Raises a subclass of WebInterfaceException if we may not modify a load
check_negative_load(load)load: load value (float)NoneCheck if the load value is negative

Raises a subclass of WebInterfaceException if the load value is negative and posting cancelation is enabled
check_project_or_task_are_finished_based_on_project_and_task(project_id, task_id)project_id: ID of the project (DI001001)
task_id: ID of the task (DI001098)
NoneCheck if the assigned project/task for a given load are finished
check_resource_assignment_is_finished(project_id, task_id, resource_id)project_id: ID of the project (DI001001)
task_id: ID of the task (DI001098)
resource_id: ID of the resource (DI001218)
NoneCheck if the resource assignment has an actual end and raise ResourceAssignmentFinishedException if so
get_current_deadline()
Current deadline (java Date object)Return the current deadline date
get_default_cost_type_from_resource(resource_id)resource_id: UUID of the resource recordDefault cost type of the resourceGet the default cost type of the given resource
get_reporting_start_and_end(project_id, task_id)project_id: ID of the project (DI001001)
task_id: ID of the task (DI001098)
Tuple of reporting start, reporting end as java Date objectsGet the reporting start and end dates of the given task in the given project
get_task_position(task_id)task_id: UUID of the task recordPosition of the task (Integer)Get the position of the given task
is_valid_resource(resource_id)resource_id: ID of the resource (DI001218)True if resource exists, False otherwiseCheck whether the given resource exists
load_exists(item)item: UUID of the load recordTrue if load exists, False otherwiseCheck whether the given load exists
max_hours_reached(resource_id, date, load, load_id=None)resource_id: ID of the resource (DI001218)
date: java Date object
load: load value (float)

load_id: UUID of the load record
NoneCheck if the maximum allowed hours for the given resource/date combination are reached and raise MaxHoursReachedException if so
project_exists(project_id)project_id: UUID of the project recordTrue if project exists, False otherwiseCheck whether the given project exists
project_is_active(project_id)project_id: ID of the project (DI001001)True if project is active, False otherwiseCheck whether the given project is active
project_is_locked(project_id)project_id: ID of the project (DI001001)True if project is locked, False otherwiseCheck whether the given project is locked
resource_exists(resource_id)resource_id: UUID of the resource recordTrue if resource exists, False otherwiseCheck whether the given resource exists
resource_is_assigned_to_task(project_id, task_id, resource_id)project_id: ID of the project (DI001001)
task_id: ID of the task (DI001098)
resource_id: ID of the resource (DI001218)
True if resource is assigned to task, False otherwiseCheck whether the given resource is assigned to the given task in the given project
task_exists(task_id)task_id: UUID of the task recordTrue if task exists, False otherwiseCheck whether the given task exists
task_is_locked(project_id, task_id)project_id: ID of the project (DI001001)
task_id: ID of the task (DI001098)
True if task is locked, False otherwiseCheck whether the given task in the given project is locked