CRUD endpoints for EntityType
Refs https://redmine.teklia.com/issues/2687
Depends #1410 (closed)
As we will implement a management interface for the new EntityType
, we need several new endpoints to create, update, delete and list their instances.
Please implement the following endpoints, along with their unit tests:
- CreateEntityType
- name
- color (optional), a random color is generated if no color is provided
- (Partial)UpdateEntityType
- name
- color
- DeleteEntityType
- only when not linked to any entity, raise a 400 if any entity with this type exists
- ListCorpusEntityTypes
- the serializer should list id, name and color for a given corpus ID
Only a corpus administrator can use the create, update and delete endpoints. A guest user can use the listing endpoint.