Kyoso-Team / kyoso

A web application that takes osu! tournaments beyonds spreadsheets.
http://kyoso.sh
GNU Affero General Public License v3.0
1 stars 1 forks source link

Create round tRPC procedures #49

Open L-Mario564 opened 2 months ago

L-Mario564 commented 2 months ago

Why?

The tournament host (and anyone with the necessary permissions) must be able to have a flexible system to cover different tournament formats.

How?

For each procedure:

If the create and update procedures end up being too complex to implement as a single procedure, each operation can be divided into three procedures, for each type of round (so instead of (createRound, you'd have createStandardRound, createQualifiersRound, createBattleRoyaleRound).

Create round

Insert a record into the Round table.

Input: name, type, targetStarRating, tournamentId and config.

Conditions

Update round

Update the Round record by Round.id.

Input: name, targetStarRating and playtestingPool, publishPool, publishSchedules, publishStats and config.

Conditions

Swap round order

The order field dictates the order in which the rounds are displayed within the tournament. The procedure must take as input the Round.id of the two roles to swap the orders of and execute a transaction that updates the order field values accordingly.

Conditions

Delete round

Delete the Round record by Round.id. The value for order must also be updated for whatever round had its order value greater than the round that will be deleted.

Conditions