Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEAT] : Core feature API for PSA, Admin and Players. #33

Open
majorbruteforce opened this issue Feb 25, 2024 · 8 comments
Open

[FEAT] : Core feature API for PSA, Admin and Players. #33

majorbruteforce opened this issue Feb 25, 2024 · 8 comments

Comments

@majorbruteforce
Copy link
Member

majorbruteforce commented Feb 25, 2024

APIs to be implemented:

Player:

  • Update : PATCH /v0/players
  • Delete (soft): DELETE /v0/players

PSA Upgrades player to admin:

Have separate collections for Admin/Player and PSA
PSA can have same mail which was used to register as player.

  • Upgrade: PATCH /v0/players/upgrade:id

After a successful upgrade:

  1. Send mail to Admin to notify the upgrade and the reason
  2. Send app notification to user about the same

Admin is responsible for moderating a match and all required API endpoints for that will be described in a separate thread.

PSA creates a Match and assigns an Admin to it:

  • Create Match: POST /v0/matches
  • Delete Match (soft): DELETE /v0/matches:id
  • Update Match : PATCH /v0/matches

The PSA creates a match with the following details:

  1. Squads/Teams/Branches Facing off
  2. Admin moderating it
  3. Venue
  4. Type
  5. Sport
  6. Time and Date
  7. Stage of match

PSA creates squads for the tournament:

A squad is an independent participant of the tournament (e.g. CSE-2 , IT-1 etc) and is a super set of teams that will play matches.
PSA will select a set of players from all verified players who have registered to the platform for a squad.

  • Fetch all players: GET /v0/players/
  • Create squad: POST /v0/squads

Include details:

  1. Squad name (Branch name + /1/2)
  2. Squad members
  3. Other required details

Entity Relationships:

Event, Team, Player, Match, Stats and Squad are separate entities.

  • There are two collection mappings which is squad player and team player.
  • Squad has squad-player, player is a squad player, squad player is in a team, team has team players, team player derives from squad player , squad plays match, team plays match, admin moderates match, match generates events.

Creating Teams

After PSA assigns a match to an Admin, the admin is responsible to create the team that plays in that match.
Match is a collection that has admin id, squad 1 and 2 id, team 1 and 2 id.

Admin can create teams from 'squad-player' collection

  • Fetch squad-players: GET /v0/players/
  • Create Team for match: POST /v0/teams/

Events

A match generates events
Events has team players + event data + sport + user id+ match id + tbd
A single player will have a single stat collection, stat document for the user will be updated after each event
Events will be trailed to the client in real-time + stored in db + tbd
Events will be the core

To be further discussed: Events implementation, Statistics Calculation, Substitutions.

@zakhaev26
Copy link
Member

zakhaev26 commented Feb 25, 2024

@majorbruteforce please update the above flow as discussed so that we can start working on the first ERD draft and proceed accordingly
Also,if possible,start making Trello tickets in the board

@majorbruteforce
Copy link
Member Author

There are still things to be described further. @zakhaev26 change the endpoints as required and delete the ones that feel redundant.

@zakhaev26
Copy link
Member

cool, will be updating it in a couple of days along with ERD draft

@zakhaev26 zakhaev26 pinned this issue Feb 26, 2024
@zakhaev26
Copy link
Member

Brief Flow

  • When a player registers in the application, their default role is set to "player".
  • The PSA (Platform Super Admin) creates a squad and bulk inserts squad players. They can then upgrade a player (selected from the set of players not already assigned to that match's participating squad/team [TBD] (for fair play) to an admin for a particular match.

Note: There should be a mechanism in place to handle the expiration of admin privileges as dicussed .

  • PSA creates a match and assigns an admin to the match.
  • The admin logs in and gains access to the Moderation Panel, where they can manage the match they are assigned to. This includes tasks such as extending match details like team assignments (team 1, team 2) and squad assignments (squad 1, squad 2).
  • The admin creates teams for the specific match and can bulk insert many players from the set of squad players to build a team.
  • The admin updates the match by associating the built team with that match and squad (this process may be done programmatically).
  • Admin Gives Approval for the match build completion flag and then the match is shown to user interfaces.
  • Once the match is set up, it generates events when admin is in scoring phase (the specifics of this implementation are to be determined).

CC: @majorbruteforce @punitkr03

@majorbruteforce
Copy link
Member Author

@zakhaev26 How are we planning to create the trello tickets?

@zakhaev26
Copy link
Member

@zakhaev26 How are we planning to create the trello tickets?

lets plan it out some other day.we don't have much of a participation yet,so we have time.
trello isn't required for managing 2-3 contributors

@majorbruteforce
Copy link
Member Author

trello isn't required for managing 2-3 contributors

Good point

@zakhaev26
Copy link
Member

zakhaev26 commented Mar 3, 2024

Created prototype sample models, do check and tell if somethings missing
Link : Model README.md
CC: @majorbruteforce @soumil-kumar17 @punitkr03

@kraytos17 kraytos17 unpinned this issue Mar 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants