Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Validate merge_person_id UUID

    1. In case of error - return 422

  2. Find preperson by id in mpi.prepersons

    1. In case of error - return 422 (Such preperson doesn't exist)

  3. Check preperson status is active in mpi.prepersons

    1. In case of error - return 409 (Preperson is not active)

  4. Check if exists another preperson merge requests with status NEW or APPROVED for this preperson

    1. if exists - update status of another requests to REJECTED

  5. Check if preperson has at least one episode

    1. if no episodes - return 422 (Preperson has no episodes)

Validate employee

  1. Extract user_id and legal_entity_id from token and find corresponding employee_id

  2. Check employee status is APPROVED

    1. In case of error - return 422 error (Only active employee can create merge request)

Validate authorize_with

If submitted, validate authorize_with field for a person as described on create Person request process. But for success case set it to il.merge_requests.authentication_method_current field instead.

...