Table of Contents |
---|
Purpose
...
Link | |
Resource | /api/person_requests |
Scope | person_request:write |
Components | |
Using Dictionaries | API paragraph not found |
Using Microservices | API paragraph not found |
Protocol type | REST |
Request type | POST |
Sync/Async | Sync |
...
Code Block |
---|
curl -X GET \ {:host}/prm/api/global_parameters |
Input parameters
Filters
None
Request structure
Example
Expand | ||
---|---|---|
| ||
|
...
Verify the validity of access token
Check user scope person_request:write in order to perform this action
validate client_id belongs to legal_entity with type in ('MSP', 'OUTPATIENT', 'EMERGENCY', 'PRIMARY_CARE')
in case error return 409, "Invalid legal entity type"
validate user belongs to employee with type in "Doctor, Specialist, Receptionist, Assistant"
in case error return 409
...
in case error return 422 - msg "Confidant person is mandatory for children"
Validate confidant person age >= prm.global_parameters.no_self_auth_age:
in case error return 422 - msg "Incorrect person age for such an action"
Validate "tax_id"
tax_id has validation pattern - `^[0-9]{10}$`
if doesn't match, return error 422 "string does not match pattern ..."
...
If person <prm.global_parameters.no_self_auth_age years, then person.auth_methods.type =
third_person
. Validate that third_person has auth method.type = OTPif third_person.auth_method.type = OFFLINE - error `THIRD PERSON can't have OFFLINE self auth method type`
if third_person.auth_method.type doesn't have active auth method - error `THIRD PERSON doesn't have active valid authentication methods`
If third person >= prm.global_parameters.no_self_auth_age years
in case error return 422, msg "Incorrect person age for such an action"
Person.auth_methods.type = third_persont.id. But on get Person request
or Person
display third_person.auth_method.phone_number.
...
Each link is generated for one one-page document in jpeg format. Document should be no more than 10MB. For each type of documents, if couple of rules worked - only one single link is generated.
Validate flag no_tax_id, if $.person_request.person.no_tax_id = true:
Generate URL with type person.no_tax_id
Validate if $.person_request.person.tax_id is not empty and $.person_request.person.no_tax_id = false then
If (GetBirthDateFromTaxId($.tax_id) != $.birth_date) or (GetGenderFromTaxId($.tax_id) != $.gender) or CheckValidity($.tax_id) = false (i.e. invalid checksum) then
Generate URL with type person.tax_id
Validate block confidant person. If person.confidant is not null:
Generate URL's with type confidant_person.{confidant_person.type}.{$.person_request.person.confidant_person.[:].documents_relationship.[:].type}
Generate URL's with type confidant_person.{confidant_person.type}.{$.person_request.person.confidant_person.[:].documents_person.[:].type}
Validate block of person documents. If one of the documents has document.type = BIRTH_CERTIFICATE_FOREIGN and there is no same document in {$.person_request.person.confidant_person.[:].documents_relationship.[:]}
and age < no_self_auth_age then
Generate URL with type person.{$.person_request.person.documents.[with type BIRTH_CERTIFICATE_FOREIGN].type}
Validate block of person documents. If one of the documents has document.type = PERMANENT_RESIDENCE_PERMIT and age >= no_self_auth_age then
Generate URL with type person.{$.person_request.person.documents.[with type PERMANENT_RESIDENCE_PERMIT].type}
Validate authentication_method. If authentication method = OFFLINE or third_person (and this third_person.auth_method = OFFLINE) -
Generate URL's with type person.{$.person_request.person.documents.[:].type} (or Generate URL's with type third_person.{$.third_person.documents.[:].type})
...
Code Block |
---|
curl -X POST \ http://localhost:4000/verifications \ -H 'content-type: application/json' \ -d '{ "phone_number": "+380936235985" }' |
Response structure
Example:
Expand | ||
---|---|---|
| ||
|
...
Verify the validity of access token
Check user scope person_request:write in order to perform this action
...