jackrobinsonuk / exercise-challenge-app

A repository for an exercise challenge app.
1 stars 0 forks source link

Leagues #35

Open usget opened 2 years ago

usget commented 2 years ago

Overview Participants in a given challenge should be organised into leagues Leagues will run from 00:00 on day 1 to 23:59 on day 6 of a given challenge week. Participants should be ranked within a given league by the number of points they have attained within a given challenge week, including any bonus points. image At the start of the next challenge week, leagues will reset. Participants will either be promoted, relegated, or remain in the same league, as per the rules below.

Promotion and points Leagues within a given challenge should be ranked from 1 (the highest/"best" league) to n (the lowest/"worst" league). At the end of each challenge week, the participant in first place in each league from 2 to n should be "promoted" to the league above. They should also be allocated 2 "tier points", as should the participant in first place in league 1. Participants in second place in all leagues should receive 1 "tier point".
Participants in last place in each league from 1 to n-1 should be "relegated" to the league below. They should also be given -1 "tier point", as should the participant in last place in league n.

Visibility All participants should be able to see the current status of the current challenge week's league tables All participants should be able to see historical league tables within a given challenge. All participants should be able to see a table of the total number of tier points won by each participant

Administration Admin should be able to allocate participants to leagues within a given challenge Admin should be able to create and edit the names of leagues within a given challenge After the start date of a challenge, new leagues should not be able to be created within that challenge.

jackrobinsonuk commented 2 years ago

To add a user to a team: Admin creates a challenge with the teams associated. This will generate unique team IDs When a user signs up, and they try to navigate to the team screen, and they are not assigned to a team yet, then a they are presented with a screen to contact an admin. A super admin can create challenges and teams. An admin can query the teams available by challenge and the users available. An admin can assign a user to a team by setting the custom team attribute on the users profile to the relevant team ID

Option 1 (easiest) From this point on, when a user adds exercise, it counts towards the team's total

Option 2 (hard) There is a lookup to figure out what users are in the team, it then queries the database and sums based on the users returned

Option 1 selected for MVP

jackrobinsonuk commented 2 years ago

UPDATE: You can now generate a league providing the generate league lambda with a challengeId and weekIndex If weekIndex === 0, it will create a standard league If weekIndex !== 0, it needs to be able to query the relevant places to update the league

It is now in a place wherein it can get the previous week's league data, it now needs to be able to query the db based on times, need to update the add-exercise function to add a timestamp in addition to the normal date for querying. @EleanorBarron1 @mkrls - I may need your advice on which timestamp to use here

Once we are able to get league data and set it for the new week, Tier points is the next challenge and figuring out where people are and updating their Tier points - also need someone better than me to handle this!!

Once complete it can then add the league data back