Table of Contents |
---|
Specification
...
- Verify the validity of access token
- in case of error return 401 ('Access denied')
- Check user scope merge_request:review in order to perform this action
- in case of error generate 401 response ('Invalid scopes')
- Verify the validity of access token
Verify user and role
Extract from token:
...
Response
Update manual_merge_requests record by ID
column | value |
---|---|
updated_at | now() |
status | $status |
comment | $comment |
Add a record to audit log
After status was changed add new record to audit_log
field | value |
---|---|
id | generate UUID |
actor_id | $user_id |
resource | 'manual_merge_process' |
resource_id | $manual_merge_process.id |
changeset | {status:$status} |
inserted_at | DATETIME |
Update manual_merge_candidates
Update assignee_id
Fetch the record from manual_merge_candidates by manual_merge_candidate_id=dedup.manual_merge_candidates.id
column | value |
---|---|
assignee_id | null |
updated_at | now() |
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:
- update manual_merge_candidates by manual_merge_candidate_id=dedup.manual_merge_candidates.id
Field | Value |
---|---|
status | $PROCESSED |
updated_at | now() |
decision | $status (by calculated qty) |
in case final decision is MERGE it should be checked whether deactivated person is a slave/master person in any other merge candidate.
a) fetch all records from manual_merge_candidates where person_id or master_person_id=$person_id
b) for such record update
Field | Value |
---|---|
status | $PROCESSED |
updated_at | now() |
decision | $MERGE |
status_reason | auto_merge |
2. Add event to terminate declaration with reason manual_merge and deactivate person by person_id to Kafka in case final decision is MERGE