A leave is a period an employee takes off work while he should otherwise be working. Employees are entitled to these either by law or by contract.

The leave-account & details

A leave references a leave-account which represents the type of leave: annual leaves, maternity, sick leave, etc... The leave-account determines:

  1. The unit (days, hours) of any leave taken on this leave-account.
  2. Whether some extra details are needed on leave taken on this leave-account. For example, companies in France are required to give a lot of details when it comes to sick leaves. Otherwise, these details should be left null.

The leave status

The leave status indicates whether the leave resource should be considered valid (i.e. the company management gave its approval) or not.

The leave-request

A leave may be subject to an approval process by the management. In this case, it must be created with the "pending" status (an "approved" leave needs no further approval) which then automatically creates a leave-request for this leave.

If a leave is created with an "approved" status, then it has no leave-request, and its status may then be changed directly through a PATCH request. The only available status would then be "cancelled".

Half-days of absence

An employee may work in the morning, and take the afternoon off, and vice versa. The startPosition and endPosition attributes represent this behavior. For example, taking the Jan. 2nd afternoon off:

{
"startsOn": "2023-01-02",
"startPosition": "secondHalfDay",
"endsOn": "2023-01-02",
"endPosition": "secondHalfDay"
}