-
Notifications
You must be signed in to change notification settings - Fork 2
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
Feat/remove team locking #135
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TeddyRoncin
force-pushed
the
feat/remove-team-locking
branch
from
June 29, 2023 23:44
caa44a6
to
06cf183
Compare
AlbanSdl
force-pushed
the
feat/remove-team-locking
branch
from
July 12, 2023 21:13
8bb2c9c
to
edd8712
Compare
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## dev #135 +/- ##
==========================================
+ Coverage 96.28% 96.50% +0.22%
==========================================
Files 109 108 -1
Lines 2260 2292 +32
Branches 322 330 +8
==========================================
+ Hits 2176 2212 +36
+ Misses 46 44 -2
+ Partials 38 36 -2
☔ View full report in Codecov by Sentry. |
TeddyRoncin
force-pushed
the
feat/remove-team-locking
branch
2 times, most recently
from
September 30, 2023 04:03
ac3eb4d
to
6958349
Compare
TeddyRoncin
force-pushed
the
feat/remove-team-locking
branch
from
October 9, 2023 18:49
d604bbc
to
c8d710a
Compare
DevNono
requested changes
Oct 13, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quelques changements mineurs à faire avant le merge
refactor: when a cart is paid, refunded or forced paid, teams can be locked or unlocked
…re is no place left fix: there was a problem when fetching player tickets in updateCart() operation
* added tests for route POST /etupay/callback * removed tests for route POST /teams/current/lock
* added the tests * fixed a bug where a team could be not full but force pay would still lock it (or put it on the waiting list)
* fixed some typos in the name of the tests of the file etupay/callback.test.ts * added some await at the end of a test to make sure instructions have finished running
* added tests * fixed a bug in file operations/carts.ts where the check of the name of the item was done wrong
* added tests * changed signature of the kickUser method : it now takes the user and not only its id * fixed a bug where any type of members made the team be unlocked when they were kicked / they left * route DELETE /teams/current/users/current no longer needs the team to not be locked
* added tests * route DELETE /teams/current/users/:userId no longer needs the team to not be locked
* added tests * the team can now be locked to make the request (it will still return an error tho, but not due to the fact that it is locked, but instead that it is full) * fixed bugs with the remake of functions kickUser and joinTeam (in the team operations file)
* added tests * team can now be locked to delete it * a team that is locked and deleted now lets its place to a team in the waiting list
* removed the middleware isTeamNotLocked, and its usages * removed the tests that tested that middleware
* added tests to verify a team in the queue would be moved to the locked teams if necessary with routes : - DELETE /teams/current/users/:userId - DELETE /teams/current/users/current - POST /admin/carts/:cartId/refund
* linted code * for operation imports : replaced single function imports by gobal imports
* team can now be locked OR in the queue * added test for that
* a test was not passing because there was neither casters nor cashprizes on the tournaments
…team), and the player has paid
…n-requests/:userId
* typo in variable name * now returning null instead of undefined when team is not in queue
TeddyRoncin
force-pushed
the
feat/remove-team-locking
branch
from
October 13, 2023 15:56
63f060a
to
f4b2177
Compare
DevNono
approved these changes
Oct 13, 2023
DevNono
added a commit
that referenced
this pull request
Sep 10, 2024
* refactor: removed routes for team locking refactor: when a cart is paid, refunded or forced paid, teams can be locked or unlocked * fix: bugs fix: we didn't check that the tournament wasn't full before locking the team fix: we didn't check that the team was full before locking team fix: discord was not setup * feat: added a queue for teams, so that they can be locked even if there is no place left fix: there was a problem when fetching player tickets in updateCart() operation * test: added tests * added tests for route POST /etupay/callback * removed tests for route POST /teams/current/lock * test: added tests for route POST /admin/users/:userId/force-pay * added the tests * fixed a bug where a team could be not full but force pay would still lock it (or put it on the waiting list) * fix: small corrections in the tests * fixed some typos in the name of the tests of the file etupay/callback.test.ts * added some await at the end of a test to make sure instructions have finished running * test: added tests for route POST /admin/carts/:cartId/refund * added tests * fixed a bug in file operations/carts.ts where the check of the name of the item was done wrong * style: linted * feat: when a players arrives/leaves a team, it may now lock/unlock the team * test: added tests for route DELETE /teams/current/users/current * added tests * changed signature of the kickUser method : it now takes the user and not only its id * fixed a bug where any type of members made the team be unlocked when they were kicked / they left * route DELETE /teams/current/users/current no longer needs the team to not be locked * test: added tests for route DELETE /teams/current/users/:userId * added tests * route DELETE /teams/current/users/:userId no longer needs the team to not be locked * test: tests for route POST /teams/current/join-requests/:userId * added tests * the team can now be locked to make the request (it will still return an error tho, but not due to the fact that it is locked, but instead that it is full) * fixed bugs with the remake of functions kickUser and joinTeam (in the team operations file) * style: linted * test: route DELETE /teams/current * added tests * team can now be locked to delete it * a team that is locked and deleted now lets its place to a team in the waiting list * fix: teams never needs to not be locked anymore * removed the middleware isTeamNotLocked, and its usages * removed the tests that tested that middleware * test: added some tests * added tests to verify a team in the queue would be moved to the locked teams if necessary with routes : - DELETE /teams/current/users/:userId - DELETE /teams/current/users/current - POST /admin/carts/:cartId/refund * style: lint * linted code * for operation imports : replaced single function imports by gobal imports * feat: updated POST /admin/users/:userId/replace * team can now be locked OR in the queue * added test for that * fix(tests): fix discord oauth to add support for nodejs 18+ crypto module * fix: /tournaments route test * a test was not passing because there was neither casters nor cashprizes on the tournaments * fix: team lock when creating a solo team (tournament with one player team), and the player has paid * fix: refreshed pnpm-lock.yaml * fix: the lockfile should be useable now * fix: tests (csgo was still used instead of cs2) * fix: added more time in the timeout for tests POST /teams/current/join-requests/:userId * feat: route GET /teams/current now also returns the position of the team in the queue * fix: linted * test: only remove the created tournament in test "GET /teams/current" * fix: small fixes * typo in variable name * now returning null instead of undefined when team is not in queue * fix: csgo to cs2 --------- Co-authored-by: AlbanSdl <[email protected]> Co-authored-by: Noah Grigis <[email protected]> Co-authored-by: Teddy Roncin <[email protected]> Co-authored-by: Noé Landré <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Before
Players had to lock their team by hand. They couldn't unlock.
Now
The lock is automatic, it is done whenever a team is full and all the members have paied. There is also a waiting list system, that allows that, when a place is freed, teams which were locked first (but could not be accepted in the tournament because their wasn't enough place) automatically have take that place.
This means that unlocking is also automatic : if a player leaves a team, this team is unlocked (and can let its place to another team in the waiting list).
There are multiple situations in which we may need to lock or unlock teams :
There is a schema to sum that up :
(sorry, it's in french, i don't want to translate it :/)