91 lines
2.9 KiB
JSON
91 lines
2.9 KiB
JSON
{
|
|
"project": "project name",
|
|
"description": "this is my first project",
|
|
"units": [
|
|
{
|
|
"name": "create_user",
|
|
"requirement_id": "REQ.01",
|
|
"description": "Creates a new user account with provided credentials and information.",
|
|
"type": "function",
|
|
"url": "create_user.py",
|
|
"parameters": {
|
|
"username": {
|
|
"type": "string",
|
|
"inout": "in",
|
|
"description": "The desired username for the new account.",
|
|
"required": true
|
|
},
|
|
"password": {
|
|
"type": "string",
|
|
"inout": "in",
|
|
"description": "The password for the new account, meeting security requirements.",
|
|
"required": true
|
|
},
|
|
"email": {
|
|
"type": "string",
|
|
"inout": "in",
|
|
"description": "The email address associated with the new account.",
|
|
"required": true
|
|
},
|
|
"phone_number": {
|
|
"type": "string",
|
|
"inout": "in",
|
|
"description": "The phone number associated with the new account.",
|
|
"required": false
|
|
},
|
|
"additional_info": {
|
|
"type": "dict",
|
|
"inout": "in",
|
|
"description": "Optional additional information about the user.",
|
|
"required": false
|
|
}
|
|
},
|
|
"return": {
|
|
"type": "dict",
|
|
"description": "Returns the created user object on success or an error message on failure.",
|
|
"on_success": {
|
|
"value": "User object containing user details such as id, username, email, etc.",
|
|
"description": "The user object representing the newly created account."
|
|
},
|
|
"on_failure": {
|
|
"value": "Error message or raises an exception.",
|
|
"description": "Details about why the user creation failed, such as validation errors or duplicate username."
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"name": "/delete_user",
|
|
"requirement_id": "REQ.02",
|
|
"description": "Deletes a user by user ID or username from the system.",
|
|
"type": "http",
|
|
"url": "http://127.0.0.1/api",
|
|
"method": "post",
|
|
"parameters": {
|
|
"user_id": {
|
|
"type": "integer",
|
|
"inout": "in",
|
|
"description": "Unique identifier of the user to be deleted.",
|
|
"required": false
|
|
},
|
|
"username": {
|
|
"type": "string",
|
|
"inout": "in",
|
|
"description": "Username of the user to be deleted.",
|
|
"required": false
|
|
}
|
|
},
|
|
"return": {
|
|
"type": "boolean",
|
|
"description": "Indicates whether the user was successfully deleted.",
|
|
"on_success": {
|
|
"value": true,
|
|
"description": "The user was successfully deleted."
|
|
},
|
|
"on_failure": {
|
|
"value": false,
|
|
"description": "The user could not be deleted, or the user does not exist."
|
|
}
|
|
}
|
|
}
|
|
]
|
|
} |