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

(GraphQL) Search for LE

Purpose

This WS is designed to allow NHS employee with assigned appropriate scopes to search Legal Entity.

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 search for a Legal Entity.

  3. User can filter list by search params

Specification

""" A condition to be used against `LegalEntity` object types. All fields are tested for equality and combined with a logical ‘and.’ """ input LegalEntityFilter { "The ID of an object" databaseId: UUID "A unique identification number of a legal entity in the State Register of Enterprises and Organizations of Ukraine." edrpou: String "In case legal entity was verified by NHS employee, nhsVerified should be true." nhsVerified: Boolean "In case legal entity was reviewed by NHS employee, nhsReview should be true." nhsReviewed: Boolean "Legal entity type. The value should be present in the `LEGAL_ENTITY_TYPE` dictionary." type: [String] "Conditions to check on fields of the object’s `addresses` field." residenceAddress: AddressFilter "Whether the legal entity is present in a unified state register or not?" edrVerified: Boolean "Legal entity status" status: LegalEntityStatus "EDRData filter" edrData: EDRDataFilter } """ A condition to be used against `EDRData` object types. All fields are tested for equality and combined with a logical ‘and.’ """ input EDRDataFilter { "The ID of an object" id: ID! "A unique identification number of a legal entity in the State Register of Enterprises and Organizations of Ukraine." edrpou: String "Official name of legal entity" name: String "Conditions to check on fields of the object’s `addresses` field." registrationAddress: AddressFilter "Flag whether `edr_data` is actual or not?" isActive: Boolean } """ Methods to use when ordering `LegalEntity`. """ enum LegalEntityOrderBy { "Sort legal entity by edrpou in ascending order." EDRPOU_ASC "Sort legal entity by edrpou in descending order." EDRPOU_DESC "Sort legal entity by inserted at in ascending order." INSERTED_AT_ASC "Sort legal entity by inserted at in descending order." INSERTED_AT_DESC "Sort legal entity by nhs review at in ascending order." NHS_REVIEWED_ASC "Sort legal entity by nhs review at in descending order." NHS_REVIEWED_DESC "Sort legal entity by nhs verified at in ascending order." NHS_VERIFIED_ASC "Sort legal entity by nhs verified at in descending order." NHS_VERIFIED_DESC "Sort legal entity by status at in ascending order." STATUS_ASC "Sort legal entity by status at in descending order." STATUS_DESC } """ A connection to a list of `LegalEntity` values. """ type LegalEntityConnection { "Information to aid in pagination." pageInfo: PageInfo! "A list of nodes." nodes: [LegalEntity] "A list of edges." edges: [LegalEntityEdge] } """ Reads and enables pagination through a set of `LegalEntity`. """ type LegalEntityEdge { "The item at the end of the edge." node: LegalEntity! "A cursor for use in pagination." cursor: String! }

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:read in order to search person

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

Validate request

Validate query params

Parameters that could be sent to prm from admin search:

  • edrpou

  • id

  • settlement

  • type

  • nhs_verified

  • nhs_reviewed

Service logic

Render LE array with results that match the search params. Return empty array if no data found

Related content

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