diff options
| author | anand <anand.panchdhari@gmail.com> | 2025-12-13 17:06:22 +0530 |
|---|---|---|
| committer | anand <anand.panchdhari@gmail.com> | 2025-12-13 17:06:22 +0530 |
| commit | bd3664c6315dca15d15bdf4d4a6342b2131e041c (patch) | |
| tree | 1c6e326bc935e4bd78490f7f495757198dd826c2 /django/factwise-python/factwise_submission/plannerapp/base | |
Diffstat (limited to 'django/factwise-python/factwise_submission/plannerapp/base')
3 files changed, 332 insertions, 0 deletions
diff --git a/django/factwise-python/factwise_submission/plannerapp/base/project_board_base.py b/django/factwise-python/factwise_submission/plannerapp/base/project_board_base.py new file mode 100644 index 0000000..71262f3 --- /dev/null +++ b/django/factwise-python/factwise_submission/plannerapp/base/project_board_base.py @@ -0,0 +1,105 @@ +class ProjectBoardBase: + """ + A project board is a unit of delivery for a project. Each board will have a set of tasks assigned to a user. + """ + + # create a board + def create_board(self, request: str): + """ + :param request: A json string with the board details. + { + "name" : "<board_name>", + "description" : "<description>", + "team_id" : "<team id>" + "creation_time" : "<date:time when board was created>" + } + :return: A json string with the response {"id" : "<board_id>"} + + Constraint: + * board name must be unique for a team + * board name can be max 64 characters + * description can be max 128 characters + """ + pass + + # close a board + def close_board(self, request: str) -> str: + """ + :param request: A json string with the user details + { + "id" : "<board_id>" + } + + :return: + + Constraint: + * Set the board status to CLOSED and record the end_time date:time + * You can only close boards with all tasks marked as COMPLETE + """ + pass + + # add task to board + def add_task(self, request: str) -> str: + """ + :param request: A json string with the task details. Task is assigned to a user_id who works on the task + { + "title" : "<board_name>", + "description" : "<description>", + "user_id" : "<team id>" + "creation_time" : "<date:time when task was created>" + } + :return: A json string with the response {"id" : "<task_id>"} + + Constraint: + * task title must be unique for a board + * title name can be max 64 characters + * description can be max 128 characters + + Constraints: + * Can only add task to an OPEN board + """ + pass + + # update the status of a task + def update_task_status(self, request: str): + """ + :param request: A json string with the user details + { + "id" : "<task_id>", + "status" : "OPEN | IN_PROGRESS | COMPLETE" + } + """ + pass + + # list all open boards for a team + def list_boards(self, request: str) -> str: + """ + :param request: A json string with the team identifier + { + "id" : "<team_id>" + } + + :return: + [ + { + "id" : "<board_id>", + "name" : "<board_name>" + } + ] + """ + pass + + def export_board(self, request: str) -> str: + """ + Export a board in the out folder. The output will be a txt file. + We want you to be creative. Output a presentable view of the board and its tasks with the available data. + :param request: + { + "id" : "<board_id>" + } + :return: + { + "out_file" : "<name of the file created>" + } + """ + pass diff --git a/django/factwise-python/factwise_submission/plannerapp/base/team_base.py b/django/factwise-python/factwise_submission/plannerapp/base/team_base.py new file mode 100644 index 0000000..29b1a5d --- /dev/null +++ b/django/factwise-python/factwise_submission/plannerapp/base/team_base.py @@ -0,0 +1,133 @@ +class TeamBase: + """ + Base interface implementation for API's to manage teams. + For simplicity a single team manages a single project. And there is a separate team per project. + Users can be + """ + + # create a team + def create_team(self, request: str) -> str: + """ + :param request: A json string with the team details + { + "name" : "<team_name>", + "description" : "<some description>", + "admin": "<id of a user>" + } + :return: A json string with the response {"id" : "<team_id>"} + + Constraint: + * Team name must be unique + * Name can be max 64 characters + * Description can be max 128 characters + """ + pass + + # list all teams + def list_teams(self) -> str: + """ + :return: A json list with the response. + [ + { + "name" : "<team_name>", + "description" : "<some description>", + "creation_time" : "<some date:time format>", + "admin": "<id of a user>" + } + ] + """ + pass + + # describe team + def describe_team(self, request: str) -> str: + """ + :param request: A json string with the team details + { + "id" : "<team_id>" + } + + :return: A json string with the response + + { + "name" : "<team_name>", + "description" : "<some description>", + "creation_time" : "<some date:time format>", + "admin": "<id of a user>" + } + + """ + pass + + # update team + def update_team(self, request: str) -> str: + """ + :param request: A json string with the team details + { + "id" : "<team_id>", + "team" : { + "name" : "<team_name>", + "description" : "<team_description>", + "admin": "<id of a user>" + } + } + + :return: + + Constraint: + * Team name must be unique + * Name can be max 64 characters + * Description can be max 128 characters + """ + pass + + # add users to team + def add_users_to_team(self, request: str): + """ + :param request: A json string with the team details + { + "id" : "<team_id>", + "users" : ["user_id 1", "user_id2"] + } + + :return: + + Constraint: + * Cap the max users that can be added to 50 + """ + pass + + # add users to team + def remove_users_from_team(self, request: str): + """ + :param request: A json string with the team details + { + "id" : "<team_id>", + "users" : ["user_id 1", "user_id2"] + } + + :return: + + Constraint: + * Cap the max users that can be added to 50 + """ + pass + + # list users of a team + def list_team_users(self, request: str): + """ + :param request: A json string with the team identifier + { + "id" : "<team_id>" + } + + :return: + [ + { + "id" : "<user_id>", + "name" : "<user_name>", + "display_name" : "<display name>" + } + ] + """ + pass + 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 + |
