ЕСОЗ - публічна документація
RС_[NEW] (GraphQl) Search Device definitions_EN
Purpose
This WS is designed to allow employee with appropriate scopes to search device definitions.
Key points
This is a GraphQL query method used in Administration panel only.
Only authenticated and authorized employee with appropriate scope can search for device definitions.
User can filter list by search params.
Specification
Authorize
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 = 'device_definition:read')
Return (403, 'Your scope does not allow to access this resource. Missing allowances: device_definition:read') in case of invalid scope(s)
Validate legal entity
Extract client_id from token.
Check legal entity status (status = ACTIVE)
In case of error - return 409 ('client_id refers to legal entity that is not active')
Check client type (type = NHS)
In case of error - return 403 ('You don't have permission to access this resource')
Service logic
Get all records from device_definitions and device_definition_names tables in PRM database
Apply additional search params (connect by logical AND):
databaseId - search by device_definitions.id (using exact match with
=
operator)deviceNames.type - seach by device_definition_names.type (using exact match with
=
operator )deviceNames.name - device_definition_names.name (using
like
match, case insensitive)isActive - search by device_definitions.is_active (using exact match with
=
operator)classificationType - search by device_definitions.classification_type (using exact match with
=
operator)manufacturerName - search by device_definitions.manufacturer_name (using
like
match, case insensitive)modelNumber - search by device_definitions.model_number (using
like
match, case insensitive)
Apply optional ordering
if no
$.orderBy
is passed - order records byinserted_at
field in descending order.
Render a response according to specification
ЕСОЗ - публічна документація