...
Check person’s certificate – invoke RPC call with third-party GetCertByNumRoleNames service using the following request params:
...
If marriage certs were requested (ByParam = 4), save each cert from formed list to dracs_marriage_certs table in transaction according to fields matching:
...
If divorce certs were requested (ByParam = 5), save each cert from formed list to dracs_divorce_certs table in transaction according to fields matching:
...
Update person_verifications table in MPI db for person_id, set values:
legal_capacity_verification_status = VERIFIED
legal_capacity_verification_reason = AUTO_ONLINE
legal_capacity_entity_id = dracs_marriage_certs.id or dracs_divorce_certs.id
legal_capacity_entity_type = ‘dracs_marriage_cert’ or ‘dracs_divorce_cert’
legal_capacity_unverified_at = null
Deactivate all existing confidant person relationships for person_id:
Deactivate all records in https://e-health-ua.atlassian.net/wiki/spaces/CSIEH/pages/17613422609724271171/IL#confidant_person_relationship_requests table where person_id =
person.id
and status = NEW, set values:status = CANCELLED
updated_at = now()
updated_by = system user_id
Deactivate all records in https://e-health-ua.atlassian.net/wiki/spaces/CSIEH/pages/17613488166724729917/MPI#confidant_person_relationships table where person_id =
person.id
and is_active = true. Set:active_to = now()
updated_at = now()
updated_by = system user_id
For each relationship from previous step - deactivate person authentication methods with type = THIRD_PERSON and value =
confidant_person_relationships.confidant_person_id
, set values:ended_at = now()
updated_at = now()
updated_by = system user_id
...