API Documentation

/employees

Endpoints

MethodPath
GET/
GET/{id}
GET/{id}/self
POST/
POST/createWithCredential
PUT/{id}
PUT/{id}/self
DELETE/{id}

Projections

NameDescription
withCredentialHas the credentials embedded.

Structure

FieldnameFieldtypeValidations
idLong
versionInteger
firstNameStringnot empty
lastNameStringnot empty
phoneNumberString
titleString
salaryNumber
hourlyCostRateNumber
joinDateDate
leaveDateDate
federalStatefederal state
vacationEntitlementNumber
LinksSecurity
credentialno update or delete
workTimesno update or delete
billableTimesno update or delete
vacationRequestsno update or delete
approvedRequestsno update or delete
travelExpenseReportsno update or delete

GET /

Find all employees.

Security

ROLE_SUPERVISOR

Returns

A page of employees.

Parameters

pageable

GET /{id}

Get a single employee by her/his id.

Security

ROLE_SUPERVISOR

Returns

A single employee.


GET /{id}/self

An accessor for employees to get their own object reduced to a few fields.

Security

Only the employee her/himself.

Returns

A reduced employee, only the fields firstName, lastName and phoneNumber are present.


POST /

Create a new employee. Returns the created object.

Security

ROLE_ADMIN

Returns

A single employee.


POST /createWithCredential

Create a new employee together with his/her credential

Security

ROLE_ADMIN

Returns

A single employee

Parameters

Expects an object containing a valid employee and credential.
{
	"employee": { "firstName": ...},
	"credential": { "email": ...}
}

PUT /{id}

Update an existing employee. If the leaveDate is in the past after the update the credential belonging to the employee will automatically be deactivated.

Security

ROLE_SUPERVISOR

Returns

A single employee.


PUT /{id}/self

An employee can update a restricted set of fields on his own employee entity with this method.

Security

Only the employee her/himself.

Returns

A single reduced employee

Parameters

The request body must be a reduced employee (can be partial):
{ "firstName": ..., "lastName": ..., "phoneNumber": ...}

DELETE /{id}

Delete the employee identified by id.

Security

ROLE_ADMIN

Returns

Nothing.