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

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »

Purpose

This WS allows to submit person on repeat verification to MVS passport stream for persons using Admin panel immediately without awaiting it’s data update or verification schedule.

Key points

  1. This graphQl method is used in Administration panel only

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

  3. It is allowed to set VERIFICATION_NEEDED status only

  4. Person could have any previous verification status to be changed on VERIFICATION_NEEDED by the mutation. That is, no status transitions there.

Specification

 index.graphql
"Updates MVS passport verification status for a single `Person` by NHS using its globally unique ID."
 updatePersonMvsPassportVerificationStatus(
    input: UpdatePersonMvsPassportVerificationStatusInput!
  ): UpdatePersonMvsPassportVerificationStatusPayload
 UpdatePersonMvsPassportVerificationStatus mutation
"""
Input for `updatePersonMvsPassportVerificationStatus` mutation.
"""
input UpdatePersonMvsPassportVerificationStatusInput {
  "Person unique identifier."
  personId: ID!
  "Person verification status"
  mvsPassportVerificationStatus: PersonVerificationStatus!
  "Person MVS passport verification reason"
  mvsPassportVerificationReason: PersonMvsPassportVerificationReason!
}
"""
Return type for `updatePersonMvsPassportVerificationStatus` mutation.
In order to verify person user must have a scope `person:verify`.
"""
type UpdatePersonMvsPassportVerificationStatusPayload {
  "Payload for person."
  person: Person
}

Authorization

  • Verify the validity of access token

    • in case of error - return 401 (“Invalid access token”) in case of validation fails

  • Verify that token is not expired

    • in case of error - return 401 (“Invalid access token”)

  • Check user scopes in order to perform this action (scope = 'person:verify')

    • return 403 (“Your scope does not allow to access this resource. Missing allowances: person:verify”) in case of invalid scope(s)

Validate legal entity

  • Extract client_id from token.

  • Check client scopes in order to perform this action (scope = 'person:verify')

    • in case of error - return 403 (“Your scope does not allow to access this resource. Missing allowances: person:verify”)

  • Check legal entity status (status = ACTIVE) and is_active=true

    • In case of error - return 409 ('client_id refers to legal entity that is not active')

Validate request

Validate input of the mutation for the following fields:

1. Person

Validate value in the field personId, identifier (ID), required

  • Check it is submitted

    • in case of error - return 422 ('required property <property name> was not present')

  • Check person exists in the DB

    • in case of error - return 404 ('Person not found')

  • Validate person has status=active and is_active=true

    • in case of error - return 409 ('Person is not active')

2. Verification status

Validate value in the field mvsPassportVerificationStatus, enum, required

  • Check it is submitted

    • in case of error - return 422 ('required property <property name> was not present')

  • Check value is VERIFICATION_NEEDED according to PERSON_VERIFICATION_STATUSES dictionary.

    • in case of error - return 422 ('value is not allowed in enum')

3. Verification reason

Validate value in the field mvsPassportVerificationReason, enum, required

  • Check it is submitted

    • in case of error - return 422 ('required property <property name> was not present')

  • Check value is MANUAL according to PERSON_VERIFICATION_STATUS_REASONS dictionary.

    • in case of error - return 422 ('value is not allowed in enum')

Service logic

  1. Set fields in person_verifications table (mpi database) for a $.personId :

    1. mvs_passport_verification_status = $.mvsPassportVerificationStatus

    2. mvs_passport_verification_reason = $.mvsPassportVerificationReason

    3. updated_by = user_id (from token)

    4. updated_at = current timestamp

    5. mvs_passport_data_id = null

    6. mvs_passport_data_status = null

    7. mvs_passport_synced_at = null

    8. mvs_passport_unverified_at = null

  2. Recalculate cumulative verification status according to logic described at https://e-health-ua.atlassian.net/wiki/spaces/EDDR/pages/18048483391/Person+verification+status+model#Cumulative-verification-status

  3. Create StatusChangeEvent in event manager with the cumulative verification status if such was changed

  • No labels