ЕСОЗ - публічна документація
MPI.Add MPI record
API specification
API logic
Basic strategy
Search existing entity
Search for existing entity using POST data parameters:
MPI attribute | Pre-condition | Condition | POST data attribute |
---|---|---|---|
MPI.person.last_name | always | equal | $.last_name |
MPI.person.first_name | always | equal | $.first_name |
MPI.person.birth_date | always | equal | $.birth_date |
MPI.person.tax_id | optional (if $.tax_id is not null) | equal | $.tax_id |
MPI.person.second_name | optional (if $.tax_id is not null) | equal | $.second_name |
Get MPI.person.id from result
In case result list consists more than one row - generate error Response__Error_ClarifySearchCriteria
Create new entity (If no record found)
Set following attributes as:
- MPI.person.created_at = now()
- MPI.person.created_by = actor (mpi_id)
- MPI.person.modified_at = MPI.person.created_at
- MPI.person.modified_by = MPI.person.created_by
Update existing entity (If record found)
Move existing record to MPI.person_hstr
Update existing record by MPI.person.id except:
- MPI.person.history
- MPI.person.created_at
- MPI.person.created_by
Set attributes as:
- MPI.person.modified_at = now()
- MPI.person.modified_by = actor (mpi_id)
ЕСОЗ - публічна документація