API Documentation

/companies

A company is a holder of projects or a debitor for projects.

Endpoints

MethodPath
GET/
GET/{id}
GET/search/findByCompanyId
GET/search/findByNameLikeIgnoreCaseOrderByNameAsc
POST/
POST/createWithAddress
PUT/{id}
DELETE/{id}

Projections

NameDescription
withAddressAndContactPersonsContains the address and contact persons.

Structure

FieldnameFieldtypeValidations
idLong
versionInteger
companyIdLong> 0, unique, not null
nameString
timeForPaymentInteger
LinksSecurity
addressdeletable, updateable by ROLE_SUPERVISOR
contactPersonsdeletable, updateable by ROLE_SUPERVISOR
projectsdeletable, updateable by ROLE_SUPERVISOR

GET /

Get all companies.

Returns

A page of companies.

Parameters

pageable

GET /{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

nametyperequireddescription
companyIdStringtrueThe company id to query for.

GET /search/findByNameLikeIgnoreCaseOrderByNameAsc

Find companies by searching for a name.

Returns

A list of companies.

Parameters

nametyperequireddescription
nameStringtrueThe 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.