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

Deactivate related legal entities


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

  • legal entity id (merged_to_id)
  • status_reason

Authorize

    1. Verify the validity of access token
      1. in case of error return 401 ('Access denied')
    2. Check user scope related_legal_entities:deactivate in order to perform this action
      1. in case of error generate 401 response ('Invalid scopes')

Validate request

  1. Validate that relationship exists
    1. Find $merged_to_id in prm.related_legal_entites
      1. in case of error return 404  error view $id ('Invalid id')
  2. Validate that relationships are active
    1. Check is_active=true
      1. in case of error return 409  error view $id ('The relationships between legal entities are already deactivated ')
  3.  Validate all merged_from legal entities are closed
    1. Find legal entities in prm.legal_entities by merged_from_id and check status='CLOSED'
      1. in case of error return 422  error view $id ('Merged_from legal entities must be closed ')

Save request

Update record to PRM.RELATED_LEGAL_ENTITIES by $ID


fieldvalue
is_activefalse

status_reason

$status_reason

updated_atnow()
updated_by$user_id

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