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

RC_[NEW] [Trembita API] Get dictionaries

Purpose

This WS is designed to return a catalog of dictionaries for integration with Trembita. Each dictionary is an object that contains not only a code and description of a value, but also a status of the value. It can represent hierarchical dictionaries with subordinate (child) values

Request

URL: /dictionaries

Method: GET

Headers

Header

Type

Required

Header

Type

Required

Uxp-Client

string

True

Uxp-Service

string

True

Uxp-Transaction-Id

string

True

In Parameters (query_parameters)

Name

Type

Cardinality

Description

Name

Type

Cardinality

Description

name

String

0..1

Dictionary name

is_active

Boolean

0..1

Dictionary status

value_code

String

0..1

Code of the dictionary value

Validations

Validate headers

  1. Check that header Uxp-Client exists and is not empty

    1. in case of error - generate response with code 400:

      • $Response.error.type = “bad_request“

      • $Response.error.code = “1008”

      • $Response.error.message = “Missed Uxp-Client header”

  2. Check that header Uxp-Service exists and is not empty

    1. in case of error - generate response with code 400:

      • $Response.error.type = “bad_request“

      • $Response.error.code = “1009”

      • $Response.error.message = “Missed Uxp-Service header”

  3. Check that header Uxp-Transaction-Id exists and is not empty

    1. in case of error - generate response with code 400:

      • $Response.error.type = “bad_request“

      • $Response.error.code = “1010”

      • $Response.error.message = “Missed Uxp-Transaction-Id header”

  4. Check that header Uxp-Client contains 4 strings that are separated by / symbol

    1. in case of error - generate response with code 400:

      • $Response.error.type = “bad_request“

      • $Response.error.code = “1011”

      • $Response.error.message = “Invalid Uxp-Client format”

  5. Check that header Uxp-Service contains 4 or 5 strings that are separated by / symbol

    1. in case of error - generate response with code 400:

      • $Response.error.type = “bad_request“

      • $Response.error.code = “1012”

      • $Response.error.message = “Invalid Uxp-Service format”

  6. Check that header Uxp-Client exists and is not empty

    1. in case of error - generate response with code 400:

      • $Response.error.type = “bad_request“

      • $Response.error.code = “1008”

      • $Response.error.message = “Missed Uxp-Client header”

Response

Each dictionary is an object that contains code, description and status of the value. It can be represented by a hierarchical structure with subordinate (child) values. Each dictionary has a definite dictionary’s labels and flag ‘is_active’ that define a dictionary status

{ "description": null, "is_active": true, "labels": [ "SYSTEM", "EXTERNAL" ], "name": "device_dispense_statuses", "values": [ { "child_values": [], "code": "completed", "description": "Виконаний", "is_active": true }, { "child_values": [], "code": "declined", "description": "Відхилений", "is_active": true }, { "child_values": [], "code": "entered_in_error", "description": "Внесений помилково", "is_active": true }, { "child_values": [], "code": "in_progress", "description": "В роботі", "is_active": true }, { "child_values": [], "code": "stopped", "description": "Припинений", "is_active": true }, { "child_values": [], "code": "unknown", "description": "Невизначений", "is_active": true } ] }

Service logic

Service returns all dictionaries filtered by submitted parameters from PRM DB (except dictionaries from the list in BIG_DICTIONARIES config. To get dictionaries from config - set it’s name in “name” query param. If the parameter "name" is specified, then the config is ignored)

  1. Get dictionaries

  2. Filter dictionaries by search params.

  3. Render a response according to specification with found dictionaries.

 

 

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