...
If equals - check that person must not be authorized by confidant person, so it doesn’t correspond to following rules:
persons age < no_self_registration_age global parameter;
persons age between no_self_registration_age and person_full_legal_capacity_age global parameters and person does not have document with type from PIS_PERSON_LEGAL_CAPACITY_DOCUMENT_TYPES config parameter;
persons age > person_full_legal_capacity_age global parameter and exists at least one active and approved confidant person relationship for person (using following process /wiki/spaces/PCAB/pages/17415995422 Check confidant person relationship with person_id = person from request - expected
:ok, :approved
response)In case of error - return 409 (‘Request must be authorized by confidant person’)
If not equal - validate relationship with following steps:
Check that there is registered relationship between
person_id
andapplicant_person_id
(MPI.confidant_person_relationships)Check that relationship is VERIFIED
In case of error - return 409 (‘Can’t confirm relationship’)
Check that
applicant_person_id
exists (status = 'active' & is_active = 'true') and has verification_status any butNOT_VERIFIED
In case of error - return 409 (‘Confidant person not found or is not verified’)
...
Validate request using JSON schema (according to /wiki/spaces/PCAB/pages/17513513023 Вимоги до набору даних персони )
Expand | |||||
---|---|---|---|---|---|
|
...
Define printout form template based on
applicant_person_id
field in token and confidant person relationship validation:If
applicant_person_id
does not equal to person_id from token - select printout form with confidant person (stored in PIS_PERSON_REQUEST_PRINTOUT_FORM_INCAPACITY_TEMPLATE_ID config param)If
applicant_person_id
equals to person_id from token - select printout form w/o confidant person (stored in PIS_PERSON_REQUEST_PRINTOUT_FORM_TEMPLATE_ID config param)
Call MAN service to render printout form
Prepare printout content based on person request data
for printout form with confidant person - additionally preload confidant person data based on
applicant_person_id
from tokenget confidant person details from
persons
table (withpersons.id
=applicant_person_id
)get confidant person documents from
person_documents
table (withperson_documents.person_id
=applicant_person_id
)get relation documents from
confidant_person_relationship_documents
table (withconfidant_person_relationship_id
= id of relationship between person and confidant person)
Render printout form and save to person request
...