CRUD endpoints for an individual room unit (for example a specific kennel or bed within a room/room group), modeled as the FHIR Location resource. None of these routes carry :organisationId in the path, so it is resolved by withOrgPermissions/withRoomUnitOrgPermissions from the x-org-id header, an organisationId query parameter, or (on create) the request body — update and delete instead resolve it by looking up the unit's own stored organisation. All routes require organisation RBAC (role-based access control) permissions.
Endpoints
POST /
- Auth:
requireWebAuth - RBAC:
withOrgPermissions, requirePermission - Body: FHIR
Locationresource (onlyresourceType: "Location"is validated; the rest is mapped viafromRoomUnitRequestDTO) - Controller:
RoomUnitController.create - Response:
201: FHIRLocationresource (viatoRoomUnitResponseDTO),400: keysmessage
PUT /:id
- Auth:
requireWebAuth - RBAC:
withRoomUnitOrgPermissions, requirePermission(resolves the organisation from the room unit's own record, not from the caller) - Params:
id - Body: FHIR
Locationresource (onlyresourceType: "Location"is validated; the rest is mapped viafromRoomUnitRequestDTO) - Controller:
RoomUnitController.update - Response:
200: FHIRLocationresource (viatoRoomUnitResponseDTO),400: keysmessage,403: keysmessage— when the body'sorganisationIddoes not match the authorized organisation
GET /
- Auth:
requireWebAuth - RBAC:
withOrgPermissions, requirePermission - Query:
roomId,unitGroupId,isActive,organisationId - Controller:
RoomUnitController.list - Response:
200: array of FHIRLocationresources,400: keysmessage
DELETE /:id
- Auth:
requireWebAuth - RBAC:
withRoomUnitOrgPermissions, requirePermission(resolves the organisation from the room unit's own record, not from the caller) - Params:
id - Controller:
RoomUnitController.delete - Response:
200: FHIRLocationresource, the deleted unit (viatoRoomUnitResponseDTO),400: keysmessage