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

Make tournament ruleset configurable #70

Open
L-Mario564 opened this issue Jun 18, 2024 · 0 comments
Open

Make tournament ruleset configurable #70

L-Mario564 opened this issue Jun 18, 2024 · 0 comments
Labels
database Database schema related issues priority: low size: lg trpc tRPC related issues ui UI & design (frontend) related issues

Comments

@L-Mario564
Copy link
Contributor

L-Mario564 commented Jun 18, 2024

Database

  • Create a Postgres enum that has the following values: standard, taiko, catch, mania.
  • Add a ruleset field on the Tournament table that is not null and type of the previously created enum. In the Typescript schema, the field doesn't have a default value, but for the migration to execute without errors we'll make ruleset nullable, then update Tournament.ruleset and set it to standard and then make the column non-nullable.
  • Add a reulsetConfig field on the Tournament table that is not null and type of jsonb. The default will be an empty object, and (at least for now) the type should include keys when rulset is mania and that can be a number between 4 and 7.

tRPC

  • Update createTournament and updateTournament to include the ruleset field and its config (add it to mutationSchemas).
  • For updateTournament, the ruleset and its config can only be changed by the host and if the tournament isn't public yet.

Tournament settings page

  • Pass the ruleset field to the frontend.
  • Add a <Select /> field so the user can change the ruleset.
  • The field must be under the general settings.
  • Just like other fields in that same category, warn the user that they can't change the value once it's public and disable and display to non-hosts that they can't change that option.
  • If the user selects mania as a ruleset, a button should be enabled that will show a form with the configuration options (the keys).
@L-Mario564 L-Mario564 added database Database schema related issues trpc tRPC related issues ui UI & design (frontend) related issues size: lg labels Jun 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
database Database schema related issues priority: low size: lg trpc tRPC related issues ui UI & design (frontend) related issues
Projects
Development

No branches or pull requests

1 participant