39 lines
1.1 KiB
Markdown
39 lines
1.1 KiB
Markdown
# KYC: admin
|
|
###### Sprint: ?
|
|
|
|
### Outcome:
|
|
admin can verify or reject(change state(selfie,poa)) of documents.
|
|
|
|
|
|
### Implementation description:
|
|
|
|
#### Endpoints:
|
|
|
|
POST {$domain}/api/v2/barong/admin/users/documents
|
|
|
|
#### File destination:
|
|
{$Dalan_Path}/app/api/v2/admin/users.rb
|
|
|
|
#### Commits:
|
|
bd7f980
|
|
|
|
#### What did we implement:
|
|
for admin apis, we should check access of user(authorization) at first.
|
|
after checking authorization, we checked existence of document and profile for related user.
|
|
update state of document.
|
|
we wrote some callbacks for every doc type to update labels state .
|
|
|
|
|
|
```mermaid
|
|
sequenceDiagram
|
|
title: admin document update
|
|
User->>Ranj: user and new state of doc
|
|
Ranj-->>Dalan: post /admin/users/documents params
|
|
Dalan->>Ranj: 400, message: 'Required params are empty'
|
|
Dalan->>Ranj: 401, message: 'Invalid bearer token', 'admin.ability.not_permitted'
|
|
Dalan->>Ranj: 404, message: 'doesnt exist'(document.user_doesnt_exist,document.document_doesnt_exist)
|
|
Dalan->>Ranj: 422, message: 'Validation errors'
|
|
Dalan->>Ranj: 200, message: 'New phone was added'
|
|
Ranj->>User: show admin result
|
|
```
|