Versions Compared

Key

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

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

    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 $parent$merged_to_id in prm.related_legal_entites
      1. in case of error return 404  error view $id ('Invalid id')
  2. Validate that relationship is relationships are active
    1. Check is_active=true
      1. in case of error return 409  error view $id ('The relationship relationships between legal entities is are already deactivated ')
  3.  Validate all child merged_from legal entities are closed
    1. Find legal entities in prm.legal_entities by childmerged_from_id and check status='CLOSED'
      1. in case of error return 422  error view $id ('Child Merged_from legal entities must be closed ')

...

Update record to PRM.RELATED_LEGAL_ENTITIES by $ID


fieldvalue
is_activefalse

status_reason

$status_reason

updated_atnow()
updated_by$user_id

...