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

Dictionary Tests

 n/ndescriptioninputsexpected_result actual_result
1Insert dictionary with existed IDduplicated idERROR: duplicate key value violates unique constraint "dictionaries_pkey" Detail: Key (id)=(f98c9549-cdef-4df3-af2f-a8f8260c7a88) already exists.ERROR: duplicate key value violates unique constraint "dictionaries_pkey" Detail: Key (id)=(f98c9549-cdef-4df3-af2f-a8f8260c7a88) already exists.
2Insert dictionary with existed nameduplicated nameERROR: duplicate key value violates unique constraint "dictionaries_name_uniq" Detail: Key (name)=(TEST) already exists.ERROR: duplicate key value violates unique constraint "dictionaries_name_uniq" Detail: Key (name)=(TEST) already exists.
3Update dictionary with existed name
"input": {
"id": "RGljdGlvbmFyeTpmOThjOTU0OS1jZGVmLTRkZjMtYWYyZi1hOGY4MjYwYzdhODg=",
    "name": "COUNTRY",
    "isActive": true
}
422, Dictionary with such name already existsUNPROCESSABLE_ENTITY
Name can't be changed
4Update not active dictionary
422, Dictionary is not activeUNPROCESSABLE_ENTITY
Deactivated dictionary is not allowed to be updated 
5Update dictionary with empty values
{
"input": {
"id": "RGljdGlvbmFyeTpmOThjOTU0OS1jZGVmLTRkZjMtYWYyZi1hOGY4MjYwYzdhODg=",
    "values": "{}"
}
}
UNPROCESSABLE_ENTITY, 
"description": "Values should not be empty"
UNPROCESSABLE_ENTITY, 
"description": "Values should not be empty"
6Update dictionary with empty labels
"input": {
"id": "RGljdGlvbmFyeTpmOThjOTU0OS1jZGVmLTRkZjMtYWYyZi1hOGY4MjYwYzdhODg=",
    "labels": []
}
UNPROCESSABLE_ENTITY
"description": "Labels should not be empty"
200, labels are updated to empty
7Update dictionary add few same keys
{
"input": {
"id": "RGljdGlvbmFyeTpmOThjOTU0OS1jZGVmLTRkZjMtYWYyZi1hOGY4MjYwYzdhODg=",
    "values": "{\"one\":\"два\",\"one\":\"один\"}"
}
}
422, Keys are duplicated200, first values is inserted
8Update dictionary add few same tags
"input": {
"id": "RGljdGlvbmFyeTpmOThjOTU0OS1jZGVmLTRkZjMtYWYyZi1hOGY4MjYwYzdhODg=",
    "labels": ["SYSTEM", "SYSTEM"]
}
422, Labels are duplicatedUNPROCESSABLE_ENTITY
Labels are duplicated
9Update dictionary by ID which doesn't exist
"input": {
"id": "RGljdGlvbmFyeTpmOThjOTU0OS1jZGVmLTRkZjMtYWYyZi1hOGY4MjYwYzdhODc="
}
NOT_FOUND
Dictionary not found
NOT_FOUND
Dictionary not found
10Deactivate dictionary
"input": {
"id": "RGljdGlvbmFyeTpmOThjOTU0OS1jZGVmLTRkZjMtYWYyZi1hOGY4MjYwYzdhODg=",
 "isActive": false
}
"Argument \"input\" has invalid value $input.\nIn field \"isActive\": Unknown field.""Argument \"input\" has invalid value $input.\nIn field \"isActive\": Unknown field."
11Activate deactivated dictionary 
"input": {
"id": "RGljdGlvbmFyeTpmOThjOTU0OS1jZGVmLTRkZjMtYWYyZi1hOGY4MjYwYzdhODg=",
 "isActive": true
}

"Argument \"input\" has invalid value $input.\nIn field \"isActive\": Unknown field."

"Argument \"input\" has invalid value $input.\nIn field \"isActive\": Unknown field."
12Rename dictionary
"input": {
"id": "RGljdGlvbmFyeTpmOThjOTU0OS1jZGVmLTRkZjMtYWYyZi1hOGY4MjYwYzdhODg=",
    "name": "TEST1"
}
422, Name can't be changed

UNPROCESSABLE_ENTITY
Name can't be changed
13Filter dictionaries by tag
"filter": {
"label": "SYSTEM"
}
200, filtered by label200, filtered by label
14Filter dictionaries by name
"filter": {
"name": "test"
}
200, filtered by name200, filtered by name
15Filter dictionaries by values.key


16

Filter dictionaries by is_active
"filter": {
"isActive": true
}
200, filtered by isActive200, filtered by isActive

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