Versions Compared

Key

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

Table of Contents

Specification

...

    1. Verify the validity of access token
      1. in case of error return 401 ('Access denied')
    2. Check user scope merge_request:review in order to perform this action
      1. in case of error generate 401 response ('Invalid scopes')

Verify user and role

Extract from token:

  1. Validate client_id (is_blocked=false)
    1. in case of error return 403 Error ('Client is blocked')
  2. Check user_roles by client_id 
    1. check whether exist role NHS_REVIEWER 
      1. in case of error return 403 Error ('User doesn't have required role')
  3. Validate client_id is NHS
    1. check client type is NHS
      1. in case of error rerun forbidden error (Client is not allowed to the action')

Validate request

  1. Check allowed status transitions: 
    1. from NEW to POSTPONE/SPLIT/MERGE/TRASH
    2. from POSTPONE to SPLIT/MERGE/TRASH
      1. in case of other transitions return CONFLICT error - 'Incorrect updated status'


Response

Update  manual_merge_requests a record by ID


column
value
updated_atnow()
status$status
comment$comment


Add a record to audit log

After status was changed  add new record to audit_log

field
value
idgenerate UUID
actor_id$user_id
resource'manual_merge_process'
resource_id$manual_merge_process.id
changeset{status:$status}
inserted_atDATETIME


Check amount of decisions

In case status was changed to final  SPLIT/MERGE/TRASH recalculate how many decisions on this merge_request was made by each status (qty).

Compare calculated qty to decision_amount. If qty=decision_amount:

  1. update manual_merge_candidates


Field 
Value
status$PROCESSED
updated_atnow()
updated_by$user_id
decision$status (by calculated qty)


2. Add even to terminate declaration and dectivate person by person_id to Kafka