ЕСОЗ - публічна документація
RC_[NEW] Get equipment details by ID
Purpose
This WS is designed to receive detailed information about equipment by ID
Specification
Authorization
Verify the validity of access token
Return (401, 'Invalid access token') in case of validation fails
Verify that token is not expired
in case of error - return (401, 'Invalid access token')
Check user scopes in order to perform this action (scope = 'equipment:read')
Return (403, 'Your scope does not allow to access this resource. Missing allowances: equipment:read') in case of invalid scope(s)
Validate equipment
Check that equipment with such ID exists in the system (is_active = true)
in case of error - return 404
Validate legal entity
Check that requested equipment belongs to the same legal entity as user
Extract
client_id
from tokenCheck that
equipments.legal_entity_id
==client_id
in case of error - return 403
Service logic
Get equipment details from prm.equipments table by equipment id from request
Preload equipment names from
prm.equipment_names
Render response according to specification.
ЕСОЗ - публічна документація