...
- issued_at, issued_by is mandatory for documents
- Validate dates
- issued_at <= now() and issued_at => birth_date
- in case `issued_at > now()` show error 422, "Document issued date should be in the past"
- in case `issued_at < person.birth_date` show error 422, "Document issued date should greater than person.birth_date "
- expiration_date > now()
- in case error show 422, "Document expiration_date should be in future"
- expiration_date is mandatory for document_type
- NATIONAL_ID
- COMPLEMENTARY_PROTECTION_CERTIFICATE
- PERMANENT_RESIDENCE_PERMIT
- REFUGEE_CERTIFICATE
- TEMPORARY_CERTIFICATE
- TEMPORARY_PASSPORT
- in case error return 422, "expiration_date is mandatory for document_type $.documents.type"
- issued_at <= now() and issued_at => birth_date
- Validate documents_type.number according to json schema
- PASSPORT - `^((?![ЫЪЭЁ])([А-ЯҐЇІЄ])){2}[0-9]{6}$`
- NATIONAL_ID - `^[0-9]{9}$`
- BIRTH_CERTIFICATE - `` ^(?![ыъэ@%&$^#`~:,.*|}{?!])[А-ЯҐЇІЄа-яґїіє0-9 №\\\"()-]+$ ``
- COMPLEMENTARY_PROTECTION_CERTIFICATE - `^((?![ЫЪЭЁ])([А-ЯҐЇІЄ])){2}[0-9]{6}$`
- PERMANENT_RESIDENCE_PERMIT - `^((?![ЫЪЭЁ])([А-ЯҐЇІЄ])){2}[0-9]{6}$`
- REFUGEE_CERTIFICATE - `^((?![ЫЪЭЁ])([А-ЯҐЇІЄ])){2}[0-9]{6}$`
- TEMPORARY_CERTIFICATE - `^((?![ЫЪЭЁ])([А-ЯҐЇІЄ])){2}[0-9]{6}$`
- TEMPORARY_PASSPORT - `` ^(?![ыъэ@%&$^#`~:,.*|}{?!])[А-ЯҐЇІЄа-яґїіє0-9 №\\\"()-]+$ `
- if `unzr`exists and is not null and matches "^[0-9]{8}-[0-9]{5}$" check if first 8 symbols = birth_date
- in case error return 422, msg "unzr or birthdate are not correct"
if documents.type=NATIONAL_ID
check if unzr exists in request, in case error return 422, msg "unzr is mandatory for document type NATIONAL_ID"
- Document numbersmaxLength < 25
Determine
...
Invoke Gandalf to obtain auth method according to internal rules:
...
language | js |
---|---|
title | cURL example |
...
auth
...
method
...
Set IL.declaration_request.authentication_method_current:
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
{
"authentication_method": GandalfResponse.$.data.final_decision,
"authentication_number": DeclarationRequest.$.declaration_request.person.authentication_methods.[0].number
} |
Determine preferable auth method for existing MPI
Set IL.declaration_request.authentication_method_current:
...
language | js |
---|---|
theme | Midnight |
title | Update auth method |
...
Determine Channel
- channel from url
- if url is for cabinet сhannel set declaration_request.сhannel = CABINET
- if not - set declaration_request.сhannel = MIS
- if url is for cabinet сhannel set declaration_request.сhannel = CABINET
...