-
Implement the
/teamendpoint with the following methods -
POST:
-
Create a new team with the given team_name and add the user to the team inProgress ishaan
- Create
team, withid = random 6 digit intname = team_name
- Create relation
teammember, with:team_id = team.iduser_id = user.idis_ready = false
- Create
-
Internally assign levels (bosses) to every team on creation todo
- Randomly shuffle IDs of
level1 to 6 - Final level will be same for every team
- Create
teamlevelassignmentrelation, withteam_id = team.idlevel_id = level.idsequence = level no. for the teamcurrent_score = 0is_finished = 0
- Randomly shuffle IDs of
-
Internally assign spells to every team on creation todo
- Assign every spell to newly created teams
- TODO
-
Create websocket channel with
idasteam.idand connect every member to it on joining -
Payload:
{"team_name": string} -
Response:
- success:
200 - failure:
{"status":"error", "description": string}
- success:
-
-
UPDATE:
- Find the team by the given team_id and add the current user to the team, provided validity manan inProgress
- Find
teamwhereteam.id = id - if valid, create relation
teammemberwith:team_id = team.iduser_id = user.idis_ready = false
- Add user to websocket channel with id
team.idtodo
- Find
- Validity Checks:
- No. of members in team < 4
- User already not part of any teams
- Team has not started game
- Payload:
{"team_id": int} - Response:
- success:
200 - failure:
{"status":"error", "description": string}
- success:
- Find the team by the given team_id and add the current user to the team, provided validity manan inProgress