Specification
Features - Create Service group
Input parameters
- name
- code
- requestAllowed
- parentGroup
...
- Verify the validity of access token
- Check user scope (scope = 'service_catalog:write') in order to perform this action
- In case error - generate 401 response
...
- Check that all elements in array of code are different where service_groups.is_active = True.
- in case of error return 422 error (message `codes are duplicated`)
Validate parent Group
Check on existing parentGroup in Service Groups.
Check exist `Service Groups` by $.service_group[].id.
if invalid - return 422 error (message: "parent Group in Service Group not found")
...
Search `Service Groups` ($.service_group[].id). Check exist any service_group.is_active=FALSE.
if exists - return 422 error (message: "Service Group is not active")
...
Search `Service Groups` ($.service_group[].id). Check exist service_group.request_allowed=TRUE.
if exists - return 422 error (message: "Parent ServiceGroup should not be allowed to request")
Create new Service Group
- Create new record in Service_groups
- Fill data
Name | Source |
---|---|
id | |
code | $.code |
name | $.name |
is_active | True |
parent_group_id | $.parent_group_id |
request_allowed | $.request_allowed |
inserted_at | :timestamp |
inserted_by | user_id |
updated_at | :timestamp |
updated_by | user_id |