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:
- Send mail to Admin to notify the upgrade and the reason
- 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:
- Squads/Teams/Branches Facing off
- Admin moderating it
- Venue
- Type
- Sport
- Time and Date
- 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:
- Squad name (Branch name + /1/2)
- Squad members
- 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.