API Documentation

/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

MethodPath
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

NameDescription
overviewThe employee, approver and expenses are embedded.
withEmployeeAndExpensesThe employee and expenses are embedded.
withExpensesThe expenses are embedded.
withExpensesAndDebitorExpenses and debitor embedded.

Structure

FieldnameFieldtypeValidations
idLong
versionInteger
statustravel expense report status
submissionDateDate
approvalDateDate
LinksSecurity
expensesdelete and update by ROLE_SUPERVISOR or owning employee
employeeNo update or delete
approverNo update or delete
comments

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

nametyperequireddescription
employeeLongtrueThe 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

pageable
nametyperequireddescription
statustravel expense report statustrueThe 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

nametyperequireddescription
startDatetrueThe start of the interval.
endDatetrueThe 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