Versions Compared

Key

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

Validate request

  1. Validate request using JSON schema

    1. In case validation failed - generate 422 error

...

  1. Verify the validity of access token

  2. Check user scopes declaration_request:writeapprove in order to perform this action

    1. In case error - generate 401 response

...

Get declaration request from IL_DB.declaration_request

Determine authorization method

Get authorization_method from IL_DB.declaration_request

Code Block
SELECT IL_DB.declaration_request.authentication_method
FROM   IL_DB.declaration_request
WHERE IL_DB.declaration_request.id = :id

If authentication_method_current is NULL - return Error

If authentication_method_current == OFFLINE - check uploaded document

If authentication_method = OTP - verify SMS code, check uploaded documents for patient request form and add phone to db.verification.verified_phones

If authentication_method = CONFIDANT and confidant has auth.method = OTP  -  verify SMS code, check uploaded documents for patient request form and  the document which confirms the guardianship.

If authentication_method = CONFIDANT and confidant has auth.method = OFFLINE  -  check uploaded documents for patient request form,a person's document, the confidant person's document and the document which confirms the guardianship._current = OTP - verify SMS code

Verify code

Invoke verification module to verify OTP

...