Table of Contents |
---|
Validate request
- Validate request using JSON schema
- In case validation failed - generate 422 error
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
{ "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": { "verification_code": { "type": "string" } }, "required": [ "verification_code" ], "additionalProperties": false } |
Authorize user
- Verify the validity of access token
- Check user scopes declaration_request:write in order to perform this action
- In case error - generate 401 response
Get declaration request details
Get declaration request from IL_DB.declaration_request
Determine authorization method
Get authorization_method from IL_DB.declaration_request
...
If authentication_method IN (SMS, SMS_TRUSTEE) - verify SMS code and check uploaded documents for declaration form
Verify code
Invoke verification module to verify OTP
Check uploaded documents
Invoke Media Content Storage to check documents exist
Check doctor's limit
Get employee.id from declaration request, get party for employee_id
...
- in case error return 422, "This doctor has X declarations and could not sign more"
Change declaration request status
- Change entity status in OPS_DB.declaration_request to APPROVED