Table of Contents |
---|
Purpose
Use this method to approve previously created Person Request.
Key features
Only authenticated and authorized user can use this service
Only NEW person request can be activated
The request can be activated only by the employee who works in the same legal entity in which the request was made.
Specification
...
Link
...
...
Посилання на Apiary або Swagger
...
Resource
...
/api/person_requests/{{id}}/actions/approve
...
Посилання на ресурс, наприклад: /api/persons/create
...
Scope
...
Scope для доступу
...
Components
...
Зазначається перелік бізнес компонентів, які використовують цей метод, наприклад: ePrescription
...
Microservices
...
Перелік мікросервісів, які використовує метод API, наприклад: Auth, ABAC
...
Protocol type
...
Тип протоколу, який використовується запитом, наприклад: SOAP | REST
...
Request type
...
Тип запиту API, наприклад: GET, POST, PATCH…
...
Sync/Async
...
Метод є синхронним чи асинхронним?
Logic
Preconditions
Global and configurable parameters
No
Input parameters
...
Input parameter
...
Values
...
Type
...
Description
...
Example
...
id
...
String
...
Required
...
eeebb86d-5cba-43c9-885b-6482ecaf826b
Filters
No
Dictionaries
API paragraph not found
Request structure
See on Apiary
Example:
Expand | ||
---|---|---|
| ||
|
Authorize
Headers
Content-Type:application/json
Authorization:Bearer c2778f3064753ea70de870a53795f5c9
api-key:uXhEczJ56adsfh3Ri9SUkc4en
Request data validation
Валідація даних
Наприклад:
Validate request using JSON schema
In case validation failed - generate 422 error
...
title | JSON schema |
---|
...
Table of Contents |
---|
Purpose
Use this method to approve previously created Person Request.
Key features
Only authenticated and authorized user can use this service
Only NEW person request can be activated
The request can be activated only by the employee who works in the same legal entity in which the request was made.
Specification
Page Properties | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Logic
Preconditions
API paragraph not found
Global and configurable parameters
No
Input parameters
Input parameter | Values | Type | Description | Example |
---|---|---|---|---|
id | String | Required | eeebb86d-5cba-43c9-885b-6482ecaf826b |
Filters
No
Dictionaries
API paragraph not found
Request structure
See on Apiary
Example:
Expand | ||
---|---|---|
| ||
|
Authorize
Verify the validity of access token
Return 401 in case validation fails.
Check scopes in order to perform this action (scope = 'person_request:write')
Return 403 in case invalid scope(s).
Headers
Content-Type:application/json
Authorization:Bearer c2778f3064753ea70de870a53795f5c9
api-key:uXhEczJ56adsfh3Ri9SUkc4en
Request data validation
Validate request using JSON schema
In case validation failed - generate 422 error
JSON Schema
Code Block | ||
---|---|---|
| ||
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"verification_code": {
"type": "string"
}
},
"required": [
"verification_code"
],
"additionalProperties": false
} |
Processing
Get person request details
Get person request from IL_DB.person_request
Determine authorization method
Get authorization_method from IL_DB.person_request
Code Block | ||
---|---|---|
| ||
SELECT IL_DB.person_request.authentication_method
FROM IL_DB.person_request
WHERE IL_DB.person_request.id = :id |
If authentication_method is NA - return error
If person have block confidant_person
- check uploaded the confidant person's document and the document which confirms the guardianship.
If person's authentication_method == OFFLINE - check uploaded documents
If authentication_method = OTP (or THIRD_PERSON.auth_method = OTP) - verify SMS code and add phone to db.verification.verified_phones
If authentication_method = THIRD_PERSON and third_person.auth_method = OFFLINE - check uploaded documents from third person
Invoke verification module to verify OTP
Check uploaded documents
Invoke Media Content Storage to check documents exist
Generate printout form
Invoke MAN to render print form.
Request mapping:
Parameter | Source |
---|---|
id | PERSON REQUEST |
cURL example
Code Block | ||
---|---|---|
| ||
curl --request POST \
--header 'Accept: text/html' \
--header 'Content-Type: application/json' \
{:host}/templates/{:person_request_printout_id}/actions/render |
Set IL.person_request.printout_content:
Code Block | ||
---|---|---|
| ||
MANResponse.$.data |
Change person request
Change entity status in IL_DB.person_request to APPROVED
Set updated_at - now() (Get current date-time)
Set updated_by - user_id (Extract user from token)
Response structure
See on Apiary
Example:
Expand | ||
---|---|---|
| ||
|
Processing*
Потрібно описати процеси, які відбуваються з даними
1. Using global parameters
Потрібно викликати глобальні параметри (Global parameters), щоб отримати наведені нижче параметри
Response structure
See on Apiary
Example:
Expand | ||
---|---|---|
| ||
|
Post-processing processes
Що має відбутися в ЦБД після опрацювання та відправлення відповіді, тощо
HTTP status codes
...
HTTP status code
...
Message
...
What caused the error
...
201
...
Response
...
...
...
...
Backward compatibility
Сумісність з попередніми версіями методу
Specification
Service logic
Validate request
Validate request using JSON schema
In case validation failed - generate 422 error
JSON Schema
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
Return 401 in case validation fails
Check scopes in order to perform this action (scope = 'person_request:write')
Return 403 in case invalid scope(s)
Get person request details
Get person request from IL_DB.person_request
Determine authorization method
Get authorization_method from IL_DB.person_request
Code Block | ||
---|---|---|
| ||
SELECT IL_DB.person_request.authentication_method
FROM IL_DB.person_request
WHERE IL_DB.person_request.id = :id |
If authentication_method is NA - return error
If person have block confidant_person
- check uploaded the confidant person's document and the document which confirms the guardianship.
If person's authentication_method == OFFLINE - check uploaded documents
If authentication_method = OTP (or THIRD_PERSON.auth_method = OTP) - verify SMS code and add phone to db.verification.verified_phones
If authentication_method = THIRD_PERSON and third_person.auth_method = OFFLINE - check uploaded documents from third person
Invoke verification module to verify OTP
Check uploaded documents
Invoke Media Content Storage to check documents exist
Generate printout form
Invoke MAN to render print form.
Request mapping:
...
Parameter
...
Source
...
id
...
PERSON REQUEST
cURL example
Code Block | ||
---|---|---|
| ||
curl --request POST \
--header 'Accept: text/html' \
--header 'Content-Type: application/json' \
{:host}/templates/{:person_request_printout_id}/actions/render |
Set IL.person_request.printout_content:
Code Block | ||
---|---|---|
| ||
MANResponse.$.data |
Change person request
...
Change entity status in IL_DB.person_request to APPROVED
...
Set updated_at - now() (Get current date-time)
...
|
Post-processing processes
API paragraph not found
HTTP status codes
Page Properties | ||||||
---|---|---|---|---|---|---|
|
Backward compatibility
API paragraph not found