ЕСОЗ - публічна документація

MPI.Add MPI record

API specification

Add MPI record specification

API logic

Basic strategy

Search existing entity

Search for existing entity using POST data parameters:

MPI attributePre-conditionConditionPOST data attribute
MPI.person.last_namealwaysequal$.last_name
MPI.person.first_namealwaysequal$.first_name
MPI.person.birth_datealwaysequal$.birth_date
MPI.person.tax_idoptional (if $.tax_id is not null)equal$.tax_id
MPI.person.second_nameoptional (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)

ЕСОЗ - публічна документація