Table of Contents |
---|
Specification
...
This WS is design to deactivate relationship after reorganization by NHS admin. This action must be done in case reorganization reorganized MSP.
Input parameters
- legal entity id (merged_to_id)
- status_reason
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 $merged_to_id in prm.related_legal_entites
- in case of error return 404 error view $id ('Invalid id')
- Find $merged_to_id in prm.related_legal_entites
- Validate that relationships are active
- Check is_active=true
- in case of error return 409 error view $id ('The relationships between legal entities are already deactivated ')
- Check is_active=true
- Validate all merged_from legal entities are closed
- Find legal entities in prm.legal_entities by merged_from_id and check status='CLOSED'
- in case of error return 422 error view $id ('Merged_from legal entities must be closed ')
- Find legal entities in prm.legal_entities by merged_from_id and check status='CLOSED'
Save request
Update record to PRM.RELATED_LEGAL_ENTITIES by ID$ID
field | value | id | id|
---|---|---|---|
is_active | false | ||
status_reason | $status_reason | ||
updated_at | now() | ||
updated_by | $user_id |
...