ЕСОЗ - публічна документація
RC_(GraphQL) Update Person UNZR verification status (DMS)
Purpose
This WS allows to submit person on repeat verification to UNZR stream using Admin panel immediately without awaiting it’s data update or verification schedule.
Key points
This graphQl method is used in Administration panel only
Only authenticated and authorized NHS employee with appropriate scope can verify persons.
It is allowed to set VERIFICATION_NEEDED status only
Person could have any previous verification status to be changed on VERIFICATION_NEEDED by the mutation. That is, no status transitions there.
Specification
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 unzrVerificationStatus
, 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 unzrVerificationReason
, 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
Set fields in person_verifications table (mpi database) for a $.
personId
:unzr_verification_status = $.
unzrVerificationStatus
unzr_verification_reason = $.
unzrVerificationReason
updated_by = user_id (from token)
updated_at = current timestamp
unzr_data_id = null
unzr_data_status = null
unzr_synced_at = null
unzr_unverified_at = null
Recalculate cumulative verification status according to logic described at https://e-health-ua.atlassian.net/wiki/spaces/EH/pages/17702781134/Person+verification+data+model#Cumulative-verification-status
Create StatusChangeEvent in event manager with the cumulative verification status if such was changed
ЕСОЗ - публічна документація