Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Specification

Schema

Features - Create Service group  

Input parameters 

  • name
  • code
  • requestAllowed
  • parentGroup

...

  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

...

  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")

...

  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