Skip to content

[#8] Create User Documentation and add a figure of users table - #19

Merged
vdennis merged 14 commits into
mainfrom
feature/user
Dec 18, 2020
Merged

[#8] Create User Documentation and add a figure of users table#19
vdennis merged 14 commits into
mainfrom
feature/user

Conversation

@vdennis

Copy link
Copy Markdown
Contributor

Init User Documentation

@jacky-htgjacky-htg left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please resolve my comments below. thanks.

Comment threaddoc/users.md
Comment threaddoc/users.md
Comment threaddoc/users.md Outdated
--- | --- | ---
name | string | dennis
username | string | vdennis
password | string | cdcgi2020

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

POST /users will be call by admin right?
it's need no password in the request payload. prefer generate random password and sent to users's email.

Comment threaddoc/users.md
Comment threaddoc/users.md
Comment threaddoc/users.md Outdated
#### Validation
- name: required and not empty
- username: required and not empty
- password: required and not empty and password score > 75

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no password required

Comment threaddoc/users.md
Comment threaddoc/users.md
Comment threaddoc/users.md Outdated
{
"name": "dennis",
"username": "vdennis",
"password": "Cdcgi2020!"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no password required

Comment threaddoc/users.md Outdated
{
"name": "dennis",
"username": "vdennis",
"password": "Cdcgi2020!",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no password required. better to generate random password for the first time, because the user will be create by admin, not by user self with registration api.

Comment threaddoc/users.md Outdated
{
"name": "dennis",
"username": "vdennis",
"password": "Cdcgi2020!",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove password

msyuniartoand others added 6 commits December 6, 2020 13:58
)
* [#3] Update Regions Documentation and add a figure of regions table
* [#3] Update Region Documentation based on review
* [#3] Update Region Documentation based on 2nd review
* [#3] add region code must be unique and remove the last line that does not need comma
* [#3] Update region-layer
* [#3] Rename regions.png to region-layer.png
* [#3] Remove company_code and kunci from regions table
Comment threaddoc/users.md Outdated
"name": "dennis",
"username": "vdennis",
"email": "vdennis@cdc.id",
"type_akses": "1"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better using int type
"type_akses": 1

Comment threaddoc/users.md Outdated
"name": "dennis",
"username": "vdennis",
"email": "vdennis@cdc.id",
"type_akses": "1",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1

Comment threaddoc/users.md Outdated
"name": "dennis",
"username": "vdennis",
"email": "vdennis@cdc.id",
"type_akses": "1",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1

Comment threaddoc/users.md Outdated
"name": "dennis",
"username": "vdennis",
"email": "vdennis@cdc.id",
"type_akses": "2"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2

Comment threaddoc/users.md Outdated
"name": "dennis",
"username": "vdennis",
"email": "vdennis@cdc.id",
"type_akses": "2",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2

Comment threaddoc/users.md Outdated
"name": "dennis",
"username": "vdennis",
"email": "vdennis@cdc.id",
"type_akses": "3",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3

Comment threaddoc/users.md Outdated
"name": "dennis",
"username": "vdennis",
"email": "vdennis@cdc.id",
"type_akses": "4",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4

Comment threaddoc/users.md Outdated
"name": "dennis",
"username": "vdennis",
"email": "vdennis@cdc.id",
"type_akses": "4",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4

Comment threaddoc/users.md Outdated
"name": "dennis",
"username": "vdennis",
"email": "vdennis@cdc.id",
"type_akses": "1",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1

Comment threaddoc/users.md Outdated
"name": "dennis",
"username": "vdennis",
"email": "vdennis@cdc.id",
"type_akses": "2",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2

Comment threaddoc/users.md
Comment threaddoc/users.md
Comment threaddoc/users.md Outdated
"status_code": "CDC-201",
"status_message": "Created",
"data": {
"id":"1",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"id": 1,

Comment threaddoc/users.md Outdated
"id":"1",
"name" : "dennis",
"username" : "vdennis",
"password" : "7f2994ecd8c1498cd0661589df5051f096fe1aca",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove password from response

Comment threaddoc/users.md Outdated
- super user access
- name: required and not empty
- username: required and not empty
- email: required and not empty

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

validate email using filter_var

Comment threaddoc/users.md
Comment threaddoc/users.md Outdated
"status_code": "CDC-200",
"status_message": "OK",
"data": {
"id":"1",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"id":1,

Comment threaddoc/users.md Outdated
"id":"1",
"name": "dennis",
"username": "vdennis",
"password": "7f2994ecd8c1498cd0661589df5051f096fe1aca",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove password

Comment threaddoc/users.md Outdated
"status_code": "CDC-200",
"status_message": "OK",
"data": {
"id":"1",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"id":1,

Comment threaddoc/users.md Outdated
"id":"1",
"name": "dennis",
"username": "vdennis",
"password": "7f2994ecd8c1498cd0661589df5051f096fe1aca",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove password

Comment threaddoc/users.md Outdated
```
{
"status_code": "cdc-400",
"status_message": "company_id is required",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in edit mode, if there is no company_id in request payload, you can use the existing data. its mean, the company_id is not changed.

Comment threaddoc/users.md Outdated
```
{
"status_code": "cdc-400",
"status_message": "region_id is required",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in edit mode, if there is no region_id, you can use the existing data. it's mean the region_id is not changed. But if any update of company_id, you should revalidate : "whether the existing region_id is still belongs to company_id"?

Comment threaddoc/users.md Outdated
```
{
"status_code": "cdc-400",
"status_message": "branch_id is required",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in edit mode, if there is no branch_id, you can use the existing data. it's mean the branch_id is not changed. But if any update of company_id, you should revalidate : "whether the existing branch_id is still belongs to company_id"?

also you should revalidate if any change region_id : "whether the existing branch_id is still belongs to region_id"?

Comment threaddoc/users.md Outdated
```
{
"status_code": "cdc-400",
"status_message": "kios_id is required",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in edit mode, if there is no kios_id, you can use the existing data. it's mean the kios_id is not changed. But if any update of company_id, you should revalidate : "whether the existing kios_id is still belongs to company_id"?

and you should revalidate if any change region_id : "whether the existing kios_id is still belongs to region_id"?

also you should revalidate if any change branch_id : "whether the existing kios_id is still belongs to branch_id"?

Comment threaddoc/users.md
Comment threaddoc/users.md Outdated
Accept | application/json
Email | admin@cdc.id

### Request Param

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

### Param Query

@vdennis
vdennis merged commit 6517688 into mainDec 18, 2020
@vdennis
vdennis deleted the feature/user branch December 18, 2020 06:41
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@vdennis@jacky-htg@msyuniarto@AhmadGozali19