/travelExpenseReports
Employees can create travel expense reports for their travel expenses. A travel expense report has a travel expense report status that can be SUBMITTED, PENDING, APPROVED or REJECTED.
Endpoints
Method | Path |
---|---|
GET | /{id} |
GET | /search/findByEmployeeOrderByStatusAsc |
GET | /search/findByStatusOrderByEmployee_LastNameAsc |
GET | /search/findBySubmissionDateBetween |
GET | /{id}/pdf |
POST | / |
PUT | /{id} |
PUT | /{id}/submit |
PUT | /{id}/approve |
PUT | /{id}/reject |
DELETE | /{id} |
Projections
Name | Description |
---|---|
overview | The employee, approver and expenses are embedded. |
withEmployeeAndExpenses | The employee and expenses are embedded. |
withExpenses | The expenses are embedded. |
withExpensesAndDebitor | Expenses and debitor embedded. |
GET /{id}▲
Get a single travelExpenseReport by its id.
Security
ROLE_SUPERVISOR or owning employee.
Returns
One travelExpenseReport.
GET /search/findByEmployeeOrderByStatusAsc▲
Get all travel expense reports for an employee.
Security
Owning employee.
Returns
List of travel expense reports.
Parameters
name | type | required | description |
---|---|---|---|
employee | Long | true | The id of the employee to fetch the reports for. |
GET /search/findByStatusOrderByEmployee_LastNameAsc▲
Find reports by their status.
Security
ROLE_SUPERVISOR
Returns
A page of travel expense reports.
Parameters
pageablename | type | required | description |
---|---|---|---|
status | travel expense report status | true | The status to search for. |
GET /search/findBySubmissionDateBetween▲
Find travel expense reports that have a submission date in an interval.
Security
ROLE_ADMIN
Returns
A list of travel expense reports.
Parameters
name | type | required | description |
---|---|---|---|
start | Date | true | The start of the interval. |
end | Date | true | The end of the interval. |
GET /{id}/pdf▲
Get the report as a PDF file
Security
ROLE_SUPERVISOR
Returns
A byte stream containgin the PDF, encoded in base 64.
POST /▲
Create a new travelExpenseReport. Returns the created object.
Security
Owning employee.
Returns
A single travelExpenseReport.
PUT /{id}▲
Update the travelExpenseReport identified by id. Returns the updated object.
Security
ROLE_SUPERVISOR
Returns
A single travelExpenseReport.
PUT /{id}/submit▲
Submit a travel expense report so a supervisor can accept it (i.e. change the status to SUBMITTED). Will send a mail to all supervisors that a new travel expense report has been submitted.
Security
Owning employee.
Returns
Nothing
PUT /{id}/approve▲
Approve a travel expense report. Sets the approval date and approver employee (to the logged in user) on the report.
Security
ROLE_SUPERVISOR but *not* the owning employee.
Returns
Nothing.
PUT /{id}/reject▲
Reject a travel expense report. Sets the approval date and approver employee (to the logged in user) on the report.
Security
ROLE_SUPERVISOR but *not* the owning employee.
Returns
Nothing.
DELETE /{id}▲
Delete the travelExpenseReport identified by id.
Security
ROLE_ADMIN or owner and status is PENDING or REJECTED.
Returns
Nothing