API Documentation

/vacationRequests

Employees can issue vacation requests that can be approved by a supervisor. A vacation request has a status, APPROVED, PENDING or REJECTED.

Endpoints

MethodPath
GET/{id}
POST/
PUT/{id}
PUT/{id}/approve
PUT/{id}/reject
DELETE/{id}

Projections

NameDescription
withEmployeeAndApproverThe employee and approver are embedded.

Structure

FieldnameFieldtypeValidations
idLong
versionInteger
startDateDatenot null
endDateDatenot null
numberOfDaysInteger
statusvacation request status
approvalDateDate
submissionTimeDate
LinksSecurity
employeeNo update or delete.
approverNo update or delete.

GET /{id}

Get a single vacation request by its id.

Security

ROLE_SUPERVISOR or owning employee.

Returns

One vacation request.


POST /

Create a new vacation request. Returns the created object.

This will also do the following: Calculate the property numberOfDays (you don't have to provide it) by excluding holidays and weekends from the time interval. It will send a mail to all supervisors that a new vacation request has been filed.

Security

ROLE_ADMIN or owning employee.

Returns

A single vacation request.


PUT /{id}

Update the vacation request identified by id. Returns the updated object.

Security

ROLE_SUPERVISOR but not owning employee.

Returns

A single vacation request.


PUT /{id}/approve

Approve a vacation request. Sends a mail to the owning employee. Sets the approver and approvalDate.

Security

ROLE_SUPERVISOR but not the owning employee.

Returns

Nothing.


PUT /{id}/reject

Reject a vacation request. Sends a mail to the owning employee. Sets the approver and approvalDate.

Security

ROLE_SUPERVISOR but not the owning employee.

Returns

Nothing.


DELETE /{id}

Delete the vacation request identified by id.

Security

ROLE_SUPERVISOR or owning employee and status is PENDING.

Returns

Nothing