Validate request
- Validate request using JSON schema
- In case validation failed - generate 422 error
Authorize user
- Verify the validity of access token
- Check user scopes person_request:write in order to perform this action
- In case error - generate 401 response
Get person request details
Get declaration request from IL_DB.person_request
Determine authorization method
Get authorization_method from IL_DB.person_request
SELECT IL_DB.person_request.authentication_method FROM IL_DB.person_request WHERE IL_DB.person_request.id = :id
If authentication_method is NULL - return Error
If authentication_method = OTP - verify SMS code and check uploaded documents for person form
Verify code
Invoke verification module to verify OTP
Change person request status
- Change entity status in IL_DB.person_request to APPROVED