def getAvailableCapacity(self, from_date, to_date, portal_type=[], node=[], resource=[], capacity_unit=None, **kw):
Calculate available capacity for a node.
Each row is the available time for a specific period
node - only take rows in stock table which node_uid is equivalent to node
portal_type - only take rows in stock table which portal_type is in portal_type parameter
resource - only take rows in stock table which resource_uid is equivalent to resource
from_date (>=) - return period which start >= from_date
to_date (<) - return period which start < to_date
capacity_unit – unit in which the capacity is returned (REQUIRED)
Person:
getAvailableCapacity =
getAvailableTime() - getInventoryList(node=person_uid, quantity_unit=second, group_by_resource_type=1) * getCapacityRatio(second, service_type=resource_type)
Organisation:
getAvailableCapacity = SUM(person.getAvailableCapacity()) [person in organisation]
Time API is defined and implemented on Selection Tool.
Aliases can be added on others classes to automatically defined some parameter.
Ex: on the Person class, node parameter is automatically calculed as the combination of the person uid and group calendar uid related to person assignment.