The leave resource
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:
- The unit (days, hours) of any leave taken on this leave-account.
- 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"
}
Unique identifier of the leave
"leave"
Date (only). First day (included) of this employee's leave.
Date (only). Last day (included) of this employee's leave.
Reference to an employee resource.
{
"id": "416",
"type": "employee",
"url": "https://example.ilucca.net/lucca-api/employees/416"
}
Reference to a leave-account resource.
{
"id": "754",
"type": "leave-account",
"url": "https://example.ilucca.net/lucca-api/leave-accounts/754"
}
Does this leave start on the first half-day (often: "morning") or the second one (often: "afternoon")?
firstHalfDay
, secondHalfDay
Does this leave end on the first half-day (often: "morning") or the second one (often: "afternoon")?
firstHalfDay
, secondHalfDay
Read-only. Lists the days or half-days (when on two different leave-accounts) of absence. It is automatically calculated by the server depending on the leave-account settings (e.g. should Saturdays be included?).
Depending on the related leave-account, a leave may be taken in hours or in days. This attribute sums up the duration of the leave on all of the days it covers. Can only be written on when creating a leave in "hours" unit.
{
"iso": "PT35H",
"value": 35,
"unit": "days"
}
Depends on the status of this leave's related leave-request.
tentative
: the leave is uncertain as it has yet to be confirmed.confirmed
: the leave will definitely be taken.cancelled
: the leave was finally cancelled, either through the approval workflow or by the employee.
tentative
, confirmed
, cancelled
Some leave-accounts required further details about the leave.
This is typically the case for sick leaves in France. In this case, set these details in this object.
Otherwise, you can just leave this null
.
Timestamp of this leave creation.
Timestamp of the time this leave was last updated.
Was this page helpful?