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

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

Specification

Schema

Features - Create Service group  

Input parameters 

  • name
  • code
  • requestAllowed
  • parentGroup

Authorize

  1. Verify the validity of access token
  2. Check user scope (scope = 'service_catalog:write') in order to perform this action
    1. In case error - generate 401 response

Validate code

  1. Check that all elements in array of code are different  where service_groups.is_active = True.
    1. in case of error return 422 error (message `codes are duplicated`)

Validate parent Group

Check on existing parentGroup in Service Groups. 

  1. Check exist `Service Groups` by $.service_group[].id.

    1. if invalid - return 422 error (message: "parent Group in Service Group not found")

Parent Group's in service group must be active  

  1. Search `Service Groups` ($.service_group[].id). Check exist any service_group.is_active=FALSE.

    1. if exists - return 422 error (message: "Service Group is not active")

Parent Group must have requestAllowed = False

  1. Search `Service Groups` ($.service_group[].id). Check exist service_group.request_allowed=TRUE.

    1. if exists - return 422 error (message: "Parent ServiceGroup should not be allowed to request")

Create new Service Group

  1. Create new record in Service_groups
  2. Fill data 
Name
Source
id
code$.code
name$.name
is_activeTrue
parent_group_id$.parent_group_id
request_allowed$.request_allowed
inserted_at:timestamp
inserted_byuser_id
updated_at:timestamp
updated_byuser_id
  • No labels