careate unique username
Closed this issue · 0 comments
as backend
I want to create user into the system by using email, username and password
So that the user should be able to create new user
Sample request
curl --location --request POST 'http://localhost:8080/api//signup' \
--header 'Content-Type: application/json' \
--data-raw '{
"usernaname": "username",
"email": "email@email.com",
"password": "password"
}'
Or
curl --location --request POST 'http://localhost:8080/api//signup' \
--header 'Content-Type: application/json' \
--data-raw '{
"email": "email@email.com"
"password": "password"
}'
Acceptance criteria 1
Given create user request sent to the create user endpoint
When username, email, password are in right format and username is uniqeu
Then backend must return successful create user response
HTTP/1.1 201 CREATED
Content-Type: application/json
{
"id": "string",
"username": "string",
"email": "string"
}
Acceptance criteria 2
Given create user request sent to the create user endpoint
When email, password are in right format and username is not defined.
Then backend create a unique username and must return successful create user response
HTTP/1.1 201 CREATED
Content-Type: application/json
{
"id": "string",
"username": "string",
"email": "string"
}
Acceptance criteria 3
Given create user request sent to the create user endpoint
When username, email, password are in right format and username is not uniqeu
Then backend must return 400 Bad Request exception
HTTP/1.1 400 Bad Request
Content-Type: application/json
{
"message": username has already been used",
"code": 400
}