Versions Compared

Key

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

...

  1. Verify the validity of access token

    1. Return 401 in case validation fails

  2. Check user scopes in order to perform this action (scope = 'merge_request:write')

    1. Return 403 in case invalid scope(s)

  3. Check the employee has created this merge request. Thus select inserted_by from il.merge_requests of this merge request and compare it with user_id from the token.

  4. Check that client_id from the token maches with il.merge_requests.legal_entity_id

    1. If not match - return 422 error (User doesn’t belong to legal entity where the merge request was created)

Validate schema

Validate request using schema (TBD)

...

Validate preperson as on create merge request process, but w/o searching pending merge requests and episodes.

Validate employee

Validate employee as on reject merge request process

Determine authorization method

...

Get all the preperson episodes for the printout form (mongodb, episodes collection).

Generate printout form

  1. Invoke MAN to render print form.

...

Parameter

Source

Description

status

Request: status

Status of the request, required. Set APPROVED

data

Request: data

Request data to sign, required. Save master_person and merge_person blocks, except idsprintout form, merge request id and status.

printout_form

text

Generated printout form (PREPERSON MERGE REQUEST)

updated_by

uuid

Extract user from token

updated_at

timestamp

Get current date-time

...