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

Track users number of wins for each leaderboard timeframe within each server #160

Open
Kevin-Roman opened this issue Jun 8, 2024 · 1 comment · Fixed by #172
Open

Track users number of wins for each leaderboard timeframe within each server #160

Kevin-Roman opened this issue Jun 8, 2024 · 1 comment · Fixed by #172
Assignees
Labels
enhancement New feature or request

Comments

@Kevin-Roman
Copy link
Contributor

Kevin-Roman commented Jun 8, 2024

Description

This feature was removed in the development and migration to the entirely different MongoDB schema that took place in May 2024. This feature could be re-implemented, this time more efficiently, and with extra features.

Potential solution

  1. Rename the Preferences document to something more appropriate such as "UserServerData".
  2. Move all preference fields into a new "Preferences" basemodel.
  3. Create a Wins basemodel that has fields for each type of leaderboard (except all-time as a win system isn't appropriate for that).
  4. Update document if user wins for a specific leaderboard in a server.
  5. Create logic to sort based on wins, and create new command param.
  6. Migrate to the new schema.
@Kevin-Roman Kevin-Roman added the enhancement New feature or request label Jun 8, 2024
@Kevin-Roman Kevin-Roman changed the title Keep track of number of users number of wins for each leaderboard timeframe within each server Keep track of users number of wins for each leaderboard timeframe within each server Jun 8, 2024
@Kevin-Roman Kevin-Roman changed the title Keep track of users number of wins for each leaderboard timeframe within each server Track users number of wins for each leaderboard timeframe within each server Jun 29, 2024
Kevin-Roman added a commit that referenced this issue Jul 13, 2024
…unt support (#172)

Prerequisite for
#160

## Description
Preference is a very specific collection, which is indexed on the server
id and user id, but it is suitable to become a more generalised
collection that could store more information about the user (such as for
the upcoming win count). So `Preference` needs to turned into a
`BaseModel` and a new document `Profile` created that contains the
preference.

## Changes
1. Rename 'Preference' document to 'Profile'. Create a new 'Preference'
basemodel that is a field within the profile documents. Update the whole
codebase to reflect these changes.
2. Create migration for converting preferences to profiles.
3. Create `update_wins` that updates all users' wins.
4. Miscellaneous function name changes.

## Post review
- [x] Migrate prod db.
@Kevin-Roman Kevin-Roman reopened this Jul 13, 2024
@Kevin-Roman
Copy link
Contributor Author

Tracking win counts has been implemented, however doesn't seem to be working in prod. A PR to hopefully address this issue has been deployed to prod.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
2 participants