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

Merge to master for shop 2023 #163

Merged
merged 19 commits into from
Oct 17, 2023
Merged

Merge to master for shop 2023 #163

merged 19 commits into from
Oct 17, 2023

Conversation

TeddyRoncin
Copy link
Member

Merge to master for shop 2023

Changes

You don't even want to know... that was hell

DevNono and others added 19 commits October 6, 2023 01:28
translated the tasks part
* feat: add mails for 2023 and delete cascade on casters

* feat: update X logo and fix lint

* fix: typo
* feat: resend email route

* fix: resendEmail tests and more

* tournamentId validator
* tournamentId typed better
* added tests for resendEmail route
* updated some tests accordingly

* fix: reverted tournament changes

* removed various errors and failes tests

* refactor: put resend mail directly in the controller

---------

Co-authored-by: Teddy Roncin <[email protected]>
* 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]>
* feat: add pokemonplayerid in teams table -> db

* fix: change Int type to String in Db

* feat: add pokemonPlayerId to POST /teams endpoint parameters

* feat: add pokemonplayerid in teams table -> db

* fix: fix linter advices

* fix: bugs

* changed field pokemonPlayerId in table Tournament to String
* return error on team creation if the pokemonPlayerId is not
specified but the tournament is the pokemon tournament

* feat: add test and fix issues on Prisma

* docs: add some docs

* fix: lint

* fix: typo

---------

Co-authored-by: Teddy Roncin <[email protected]>
Co-authored-by: Noé Landré <[email protected]>
Co-authored-by: Noé Landré <[email protected]>
* feat: item availability, checks at cart creation

* fix: it is now possible to modify the availability dates

* it has been implemented in PATCH /admin/items/:id

* fix: lint

* feat: everything is now modifiable in the item

* fix: also the route wasn't working 😄

* feat: now passing the stockDifference and not the stock

* now testing each transactionState
* there is a brand new function to generate a fake cart

* fix: lint

---------

Co-authored-by: Pulpss <[email protected]>
Co-authored-by: Teddy Roncin <[email protected]>
* feat: add partners and tournament position

* fix: tests ?

* feat: add docs and fix tests

* fix: add Partner code

* fix: test and api

* fix: review

* fix: typo

* fix: fixes

* fix: fixes
* fix: discord oauth

* fix: lint
Co-authored-by: Teddy Roncin <[email protected]>
* test: a tournament was modified in this test

* feat: items now have a position

* fix: forgot some commented code

---------

Co-authored-by: Teddy Roncin <[email protected]>
* feat: only 1 coach is allowed per 1-player-tournament team

* The check for the number of coach is now done on request accept, and not on request creation
* fixed a bug in PATCH /admin/tournaments/:tournamentId

* fix: lint

* test: they now all have a timeout of 30s

---------

Co-authored-by: Teddy Roncin <[email protected]>
* fix: any number of teams can now be created per tournament

* fix: lint

---------

Co-authored-by: Teddy Roncin <[email protected]>
@codecov
Copy link

codecov bot commented Oct 17, 2023

Codecov Report

Attention: 13 lines in your changes are missing coverage. Please review.

Comparison is base (3333d71) 96.50% compared to head (f6f6242) 96.36%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #163      +/-   ##
==========================================
- Coverage   96.50%   96.36%   -0.15%     
==========================================
  Files         108      110       +2     
  Lines        2231     2336     +105     
  Branches      318      332      +14     
==========================================
+ Hits         2153     2251      +98     
- Misses         42       47       +5     
- Partials       36       38       +2     
Files Coverage Δ
src/controllers/admin/partners/addPartner.ts 100.00% <100.00%> (ø)
src/controllers/admin/partners/getPartners.ts 100.00% <100.00%> (ø)
src/controllers/admin/partners/removePartner.ts 100.00% <ø> (ø)
src/controllers/admin/partners/updatePartner.ts 100.00% <ø> (ø)
...ntrollers/admin/partners/updatePartnersPosition.ts 100.00% <100.00%> (ø)
.../controllers/admin/tournaments/updateTournament.ts 95.83% <100.00%> (+1.38%) ⬆️
...ers/admin/tournaments/updateTournamentsPosition.ts 100.00% <100.00%> (ø)
src/controllers/admin/users/replace.ts 100.00% <100.00%> (ø)
src/controllers/discord/oauth.ts 100.00% <100.00%> (+4.54%) ⬆️
src/controllers/partners/getPartners.ts 100.00% <100.00%> (ø)
... and 24 more

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@TeddyRoncin TeddyRoncin merged commit 0fc750b into master Oct 17, 2023
11 checks passed
DevNono pushed a commit that referenced this pull request Sep 10, 2024
Merge to master for shop 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants