ЕСОЗ - публічна документація

RC_[NEW] Get equipment details by ID

Purpose

This WS is designed to receive detailed information about equipment by ID

Specification

Apiary

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 token

  • Check that equipments.legal_entity_id == client_id

    • in case of error - return 403

Service logic

  1. Get equipment details from prm.equipments table by equipment id from request

  2. Preload equipment names from prm.equipment_names

  3. Render response according to specification.

ЕСОЗ - публічна документація