API Documentation
/companies
A company is a holder of projects or a debitor for projects.
Endpoints
| Method | Path |
|---|---|
| GET | / |
| GET | /{id} |
| GET | /search/findByCompanyId |
| GET | /search/findByNameLikeIgnoreCaseOrderByNameAsc |
| POST | / |
| POST | /createWithAddress |
| PUT | /{id} |
| DELETE | /{id} |
Projections
| Name | Description |
|---|---|
| withAddressAndContactPersons | Contains the address and contact persons. |
Structure
| Fieldname | Fieldtype | Validations |
|---|---|---|
| id | Long | |
| version | Integer | |
| companyId | Long | > 0, unique, not null |
| name | String | |
| timeForPayment | Integer | |
| Links | Security | |
| address | deletable, updateable by ROLE_SUPERVISOR | |
| contactPersons | deletable, updateable by ROLE_SUPERVISOR | |
| projects | deletable, updateable by ROLE_SUPERVISOR | |
GET /▲
Get all companies.
Returns
A page of companies.
Parameters
pageableGET /{id}▲
Get a single company time by its id.
Returns
One company.
GET /search/findByCompanyId▲
Find companies by their id.
Returns
A list of companies.
Parameters
| name | type | required | description |
|---|---|---|---|
| companyId | String | true | The company id to query for. |
GET /search/findByNameLikeIgnoreCaseOrderByNameAsc▲
Find companies by searching for a name.
Returns
A list of companies.
Parameters
| name | type | required | description |
|---|---|---|---|
| name | String | true | The name to search for. Wildcards are %. |
POST /▲
Create a new company. Returns the created object.
Since a company needs an address, use /createWithAddress instead.
Security
ROLE_ADMIN
Returns
A single company.
POST /createWithAddress▲
Create a new company together with an address.
Security
ROLE_ADMIN
Returns
A single company.
Parameters
The request body must contain an object consisting of a valid company and address.
{
"company": { "companyId": ...},
"address": { "street": ...}
}PUT /{id}▲
Update the company identified by id. Returns the updated object.
Security
ROLE_ADMIN
Returns
A single company.
DELETE /{id}▲
Delete the company identified by id.
Security
ROLE_ADMIN
Returns
Nothing.