...
Verify the validity of access token
Return 401 in case validation fails
Check user scopes in order to perform this action (scope = 'merge_request:write')
Return 403 in case invalid scope(s)
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.
Check that client_id from the token maches with il.merge_requests.legal_entity_id
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
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 |
...