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

(GraphQL) Review Legal Entity by NHS

Purpose

This WS is designed to allow NHS employee with assigned appropriate scopes to review new Legal Entities or if the Legal Entity data or its license was changes.

Key points 

  1. This is a graphQl query method used in Administration panel only.

  2. Only authenticated and authorized NHS employee with appropriate scope can verify Legal Entity.

Specification

""" Input for `nhsReviewLegalEntity` mutation. """ input NhsReviewLegalEntityInput { "Legal entity database unique identifier." id: ID! } """ Return type for `nhsReviewLegalEntity` mutation. In order to review legal entity user must have a scope `legal_entity:nhs_verify`. """ type NhsReviewLegalEntityPayload { "Payload for legal entity." legalEntity: LegalEntity }

Authorize

  1. Verify the validity of access token

    1. Return 401 in case validation fails

  2. Verify that token is not expired

    1. in case of error - return (401, 'Invalid access token')

  3. Check user scopes

    1. legal_entity:nhs_verify in order to search person

      1. In case of invalid scope, return: "You don't have permission to access this resource

Validate request

  1. Check Legal entity status (active or suspended)

    1. in case of error - return ("Legal entity cannot be reviewed due to its status")

  2. Check LE was reviewed status

    1. if nhs_reviewed = true

      1. return ("LegalEntity has been already reviewed.")

Processing

Update LE nhs_reviewed

  1. Update LE (PRM)

    1. set nhs_reviewed = 'true'

  2. Return LE details include new status nhs_reviewed

 

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