...

  1. Check at least one of allowed field is submitted and has value:

    • first_name

    • last_name

    • second_name

    • gender

    • external_id

    • birth_date

    • emergency_contact

    • death_date

      • In case of error - return 422 (Schema validation failed)

  2. Check if any forbidden field is submitted:

    • note

    • status

      1. In case of error - return 422 (Schema validation failed)

Validate death date

  • Validate death_date < now():

    • In case of error - return 422 - “Death date can not be in future”

  • If submitted, set mpi.preperson.status = inactive

Update object in DB

prepersons table

...