diff options
Diffstat (limited to 'django/factwise-python/factwise_submission/plannerapp/base/user_base.py')
| -rw-r--r-- | django/factwise-python/factwise_submission/plannerapp/base/user_base.py | 94 |
1 files changed, 94 insertions, 0 deletions
diff --git a/django/factwise-python/factwise_submission/plannerapp/base/user_base.py b/django/factwise-python/factwise_submission/plannerapp/base/user_base.py new file mode 100644 index 0000000..ec4dbc7 --- /dev/null +++ b/django/factwise-python/factwise_submission/plannerapp/base/user_base.py @@ -0,0 +1,94 @@ +class UserBase: + """ + Base interface implementation for API's to manage users. + """ + + # create a user + def create_user(self, request: str) -> str: + """ + :param request: A json string with the user details + { + "name" : "<user_name>", + "display_name" : "<display name>" + } + :return: A json string with the response {"id" : "<user_id>"} + + Constraint: + * user name must be unique + * name can be max 64 characters + * display name can be max 64 characters + """ + pass + + # list all users + def list_users(self) -> str: + """ + :return: A json list with the response + [ + { + "name" : "<user_name>", + "display_name" : "<display name>", + "creation_time" : "<some date:time format>" + } + ] + """ + pass + + # describe user + def describe_user(self, request: str) -> str: + """ + :param request: A json string with the user details + { + "id" : "<user_id>" + } + + :return: A json string with the response + + { + "name" : "<user_name>", + "description" : "<some description>", + "creation_time" : "<some date:time format>" + } + + """ + pass + + # update user + def update_user(self, request: str) -> str: + """ + :param request: A json string with the user details + { + "id" : "<user_id>", + "user" : { + "name" : "<user_name>", + "display_name" : "<display name>" + } + } + + :return: + + Constraint: + * user name cannot be updated + * name can be max 64 characters + * display name can be max 128 characters + """ + pass + + def get_user_teams(self, request: str) -> str: + """ + :param request: + { + "id" : "<user_id>" + } + + :return: A json list with the response. + [ + { + "name" : "<team_name>", + "description" : "<some description>", + "creation_time" : "<some date:time format>" + } + ] + """ + pass + |
