Specification
APIARY
Purpose
This WS is design to deactivate relationship after reorganization by NHS admin. This action must be done in case reorganization reorganized MSP.
Input parameters
Authorize
- Verify the validity of access token
- in case of error return 401 ('Access denied')
- Check user scope related_legal_entities:deactivate in order to perform this action
- in case of error generate 401 response ('Invalid scopes')
- Verify the validity of access token
Validate request
- Validate that relationship exists
- Find $id in prm.related_legal_entites
- in case of error return 404 error view $id ('Invalid id')
- Find $id in prm.related_legal_entites
- Validate that relationship is active
- Check is_active=true
- in case of error return 409 error view $id ('The relationship between legal entities is already deactivated ')
- Check is_active=true
- Validate all child legal entities is closed
- Find legal entities in prm.legal_entities by child_id and check status='CLOSED'
- in case of error return 422 error view $id ('Child legal entities must be closed ')
- Find legal entities in prm.legal_entities by child_id and check status='CLOSED'
Save request
Update record to PRM.RELATED_LEGAL_ENTITIES by $ID
field | value |
---|---|
is_active | false |
updated_at | now() |
updated_by | $user_id |