/employees
Endpoints
| Method | Path |
|---|---|
| GET | / |
| GET | /{id} |
| GET | /{id}/self |
| POST | / |
| POST | /createWithCredential |
| PUT | /{id} |
| PUT | /{id}/self |
| DELETE | /{id} |
Projections
| Name | Description |
|---|---|
| withCredential | Has the credentials embedded. |
Structure
| Fieldname | Fieldtype | Validations |
|---|---|---|
| id | Long | |
| version | Integer | |
| firstName | String | not empty |
| lastName | String | not empty |
| phoneNumber | String | |
| title | String | |
| salary | Number | |
| hourlyCostRate | Number | |
| joinDate | Date | |
| leaveDate | Date | |
| federalState | federal state | |
| vacationEntitlement | Number | |
| Links | Security | |
| credential | no update or delete | |
| workTimes | no update or delete | |
| billableTimes | no update or delete | |
| vacationRequests | no update or delete | |
| approvedRequests | no update or delete | |
| travelExpenseReports | no update or delete | |
GET /▲
Find all employees.
Security
ROLE_SUPERVISOR
Returns
A page of employees.
Parameters
pageableGET /{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
{
"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
{ "firstName": ..., "lastName": ..., "phoneNumber": ...}DELETE /{id}▲
Delete the employee identified by id.
Security
ROLE_ADMIN
Returns
Nothing.