From 4385235a66e7e6d4f75ce8b7df23cb35211adb8c Mon Sep 17 00:00:00 2001 From: Antoine Dufils Date: Fri, 14 Nov 2025 21:03:22 +0100 Subject: [PATCH 1/8] fix: remove rent filtering in fetchUserItems --- src/operations/item.ts | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/operations/item.ts b/src/operations/item.ts index f3074fd6..33be4453 100644 --- a/src/operations/item.ts +++ b/src/operations/item.ts @@ -1,5 +1,5 @@ import database from '../services/database'; -import { Item, ItemCategory, RawItem, Team, TransactionState, User, UserType } from '../types'; +import { Item, ItemCategory, RawItem, Team, TransactionState, User } from '../types'; import { isPartnerSchool } from '../utils/helpers'; import { checkForExpiredCarts } from './carts'; import { fetchTournament } from './tournament'; @@ -73,11 +73,6 @@ export const fetchUserItems = async (team?: Team, user?: User) => { items.find((element) => element.id === 'discount-switch-ssbu').left = -1; } - if (!user || user.type !== UserType.player || !team || team.tournamentId === 'ssbu') { - // Remove rents - items = items.filter((element) => element.category !== ItemCategory.rent); - } - const ffsu = team?.tournamentId ? (await fetchTournament(team?.tournamentId)).ffsu : false; const currentTicket = ffsu From 0263d261035324767199764c54c73f91a79e2e12 Mon Sep 17 00:00:00 2001 From: Antoine Dufils Date: Fri, 14 Nov 2025 21:05:09 +0100 Subject: [PATCH 2/8] fix: comment out rent filtering logic in fetchUserItems --- src/operations/item.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/operations/item.ts b/src/operations/item.ts index 33be4453..83b8a3ec 100644 --- a/src/operations/item.ts +++ b/src/operations/item.ts @@ -73,6 +73,14 @@ export const fetchUserItems = async (team?: Team, user?: User) => { items.find((element) => element.id === 'discount-switch-ssbu').left = -1; } + // if ( + // (!user || user.type === UserType.spectator || !team || team.tournamentId === 'ssbu') && + // !user.permissions.includes(Permission.orga) + // ) { + // // Remove rents + // items = items.filter((element) => element.category !== ItemCategory.rent); + // } + const ffsu = team?.tournamentId ? (await fetchTournament(team?.tournamentId)).ffsu : false; const currentTicket = ffsu From d0eaf53c10e241059dadea265313182b3a4b9390 Mon Sep 17 00:00:00 2001 From: Antoine Dufils Date: Fri, 14 Nov 2025 21:16:39 +0100 Subject: [PATCH 3/8] fix: test after rent item modification --- tests/items/getItems.test.ts | 24 ++++++++++++------------ tests/users/createCart.test.ts | 21 --------------------- 2 files changed, 12 insertions(+), 33 deletions(-) diff --git a/tests/items/getItems.test.ts b/tests/items/getItems.test.ts index d1859ac9..da3fba01 100644 --- a/tests/items/getItems.test.ts +++ b/tests/items/getItems.test.ts @@ -80,8 +80,8 @@ describe('GET /items', () => { display: true, }, }); - // without the "discount-switch-ssbu" item and the "ticket-player-ssbu", the "pc" (in rent category) and the 'ticket-player' item - expect(response.body).to.have.lengthOf(items.length - 4); + // without the "discount-switch-ssbu" item and the "ticket-player-ssbu" and the 'ticket-player' item + expect(response.body).to.have.lengthOf(items.length - 3); expect(response.body).not.to.have.deep.members([items[0]]); }); @@ -89,16 +89,16 @@ describe('GET /items', () => { const items = await database.item.findMany(); const response = await request(app).get('/items').expect(200); - // without the "discount-switch-ssbu" item and the "ticket-player-ssbu" and the "pc" (in rent category) - expect(response.body).to.have.lengthOf(items.length - 3); + // without the "discount-switch-ssbu" item and the "ticket-player-ssbu" + expect(response.body).to.have.lengthOf(items.length - 2); }); it('should return 200 with an array of items with the "discount-switch-ssbu" item', async () => { const items = await database.item.findMany(); const response = await request(app).get('/items').set('Authorization', `Bearer ${captainToken}`).expect(200); - // with the "discount-switch-ssbu" item but without the legacy "ticket-player" and without "pc" (in rent category) - expect(response.body).to.have.lengthOf(items.length - 2); + // with the "discount-switch-ssbu" item but without the legacy "ticket-player" + expect(response.body).to.have.lengthOf(items.length - 1); }); it(`should return 200 with an array of items with the "discount-switch-ssbu" and a quantity of -1 item because user has a pending cart containing it`, async () => { @@ -109,8 +109,8 @@ describe('GET /items', () => { const items = await database.item.findMany(); const response = await request(app).get('/items').set('Authorization', `Bearer ${thirdCaptainToken}`).expect(200); - // without the legacy "ticket-player" and without "pc" (in rent category) - expect(response.body).to.have.lengthOf(items.length - 2); + // without the legacy "ticket-player" + expect(response.body).to.have.lengthOf(items.length - 1); expect(response.body.find((item: Item) => item.id === 'discount-switch-ssbu').left).to.be.equal(-1); }); @@ -122,8 +122,8 @@ describe('GET /items', () => { const items = await database.item.findMany(); const response = await request(app).get('/items').set('Authorization', `Bearer ${thirdCaptainToken}`).expect(200); - // without the "discount-switch-ssbu" item and the legacy "ticket-player" and without "pc" (in rent category) - expect(response.body).to.have.lengthOf(items.length - 3); + // without the "discount-switch-ssbu" item and the legacy "ticket-player" + expect(response.body).to.have.lengthOf(items.length - 2); }); describe('should return 200 with an array of items with the "discount-switch-ssbu" item because user has a cart containing it, but it was not paid nor it is pending', () => { @@ -137,8 +137,8 @@ describe('GET /items', () => { .set('Authorization', `Bearer ${thirdCaptainToken}`) .expect(200); - // with the "discount-switch-ssbu" item but without the legacy "ticket-player" and without "pc" (in rent category) - expect(response.body).to.have.lengthOf(items.length - 2); + // with the "discount-switch-ssbu" item but without the legacy "ticket-player" + expect(response.body).to.have.lengthOf(items.length - 1); }); } }); diff --git a/tests/users/createCart.test.ts b/tests/users/createCart.test.ts index 82b8a812..7f43442d 100644 --- a/tests/users/createCart.test.ts +++ b/tests/users/createCart.test.ts @@ -479,27 +479,6 @@ describe('POST /users/current/carts', () => { ); }); - it('should error as spectator cannot rent a pc', async () => { - const spectator = await createFakeUser({ type: UserType.spectator }); - const specToken = generateToken(spectator); - - return request(app) - .post(`/users/current/carts`) - .set('Authorization', `Bearer ${specToken}`) - .send({ - tickets: { - userIds: [], - }, - supplements: [ - { - itemId: 'pc', - quantity: 1, - }, - ], - }) - .expect(404, { error: Error.ItemNotFound }); - }); - it('should sucessfully create a cart with a rental pc', async () => { const userToken = generateToken(notValidUserWithSwitchDiscount); From 57e54dcbd1e7cf3517e2915791d1bacdf7141454 Mon Sep 17 00:00:00 2001 From: Remi-pcn Date: Mon, 17 Nov 2025 12:51:30 +0100 Subject: [PATCH 4/8] fix: president + color in white --- src/controllers/admin/badges/generateBadges.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/controllers/admin/badges/generateBadges.ts b/src/controllers/admin/badges/generateBadges.ts index 5aeffc04..e7a356b2 100644 --- a/src/controllers/admin/badges/generateBadges.ts +++ b/src/controllers/admin/badges/generateBadges.ts @@ -36,7 +36,7 @@ const getCommisionPermission = (commissionRole: string, commissionId: string) => }; const getCommissionName = (commissionRole: string, commissionId: string, commissionName: string) => { - if (commissionId === 'coord' && commissionRole === 'respo') return 'Présidente'; + if (commissionId === 'coord' && commissionRole === 'respo') return 'Président'; if (commissionRole === 'respo') return `Respo ${commissionName}`; return commissionName; From 7773bda3b8b1c1fafc35704d1269c00ad085865f Mon Sep 17 00:00:00 2001 From: Remi-pcn Date: Mon, 17 Nov 2025 12:51:34 +0100 Subject: [PATCH 5/8] fix: color --- src/utils/badge.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/utils/badge.ts b/src/utils/badge.ts index d0e298e7..09a4bc76 100644 --- a/src/utils/badge.ts +++ b/src/utils/badge.ts @@ -162,7 +162,8 @@ export const generateBadge = async (badges: Badge[]) => { // Place the text containing the name is the bottom middle in bold and in uppercase // Define a text format - const color: PDFKit.Mixins.ColorValue = badges[index].type === 'fullaccess' ? [239, 220, 235] : [23, 18, 74]; + // const color: PDFKit.Mixins.ColorValue = badges[index].type === 'fullaccess' ? [239, 220, 235] : [23, 18, 74]; + const color: PDFKit.Mixins.ColorValue = [255, 255, 255]; const textFormat = document.font(fontFamily).fill(color).fontSize(fontSize); From 6dc6d279c4a627204df4c492aa7e2f91aa2cb63a Mon Sep 17 00:00:00 2001 From: Antoine D Date: Thu, 20 Nov 2025 12:20:22 +0100 Subject: [PATCH 6/8] ci: not use prisma 7 --- .github/workflows/ci.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 136c1ed0..d0a7a670 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,7 +22,7 @@ jobs: node-version: ${{ matrix.node-version }} cache: 'pnpm' - run: pnpm install --frozen-lockfile - - run: pnpm pnpx prisma generate + - run: pnpm prisma generate - run: pnpm lint build: @@ -41,7 +41,7 @@ jobs: node-version: ${{ matrix.node-version }} cache: 'pnpm' - run: pnpm install --frozen-lockfile - - run: pnpm pnpx prisma generate + - run: pnpm prisma generate - run: pnpm build test: @@ -76,8 +76,8 @@ jobs: node-version: ${{ matrix.node-version }} cache: 'pnpm' - run: pnpm install --frozen-lockfile - - run: pnpm pnpx prisma generate - - run: pnpm pnpx prisma db push + - run: pnpm prisma generate + - run: pnpm prisma db push - run: docker exec -i mariadb mysql -utest -ptest arena < seed.sql - run: pnpm test:coverage - uses: codecov/codecov-action@v5 @@ -108,7 +108,7 @@ jobs: node-version: ${{ matrix.node-version }} cache: 'pnpm' - run: pnpm install --frozen-lockfile - - run: pnpm pnpx prisma generate + - run: pnpm prisma generate - env: BRANCH: ${{ github.ref == 'refs/heads/master' && 'master' || 'dev' }} DBDOCS_TOKEN: ${{ secrets.DBDOCS_TOKEN }} @@ -133,7 +133,7 @@ jobs: password: ${{ secrets.REGISTRY_TOKEN }} - name: Build and push uses: docker/build-push-action@v6 - with: + with: push: true tags: | ${{ secrets.REGISTRY_URL }}/uttarena/api:${{ github.ref == 'refs/heads/master' && 'master' || 'dev' }} From 55f390e50768937348ffef9d0eead341a95ea6ea Mon Sep 17 00:00:00 2001 From: Antoine D Date: Thu, 20 Nov 2025 12:33:17 +0100 Subject: [PATCH 7/8] ci: dockerfile disable prisma7 --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index a8f4ab4f..85e5e85c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,10 +16,10 @@ RUN pnpm install --frozen-lockfile --production=false COPY --chown=node:node ./ ./ -RUN pnpm pnpx prisma generate +RUN pnpm prisma generate RUN pnpm build # Prunes devDependencies RUN pnpm install --production --ignore-scripts --prefer-offline -CMD pnpm start \ No newline at end of file +CMD pnpm start From 044665e73a62f370ca7628c84a69f598beae6840 Mon Sep 17 00:00:00 2001 From: Antoine D Date: Thu, 20 Nov 2025 22:57:46 +0100 Subject: [PATCH 8/8] fix: update Discord invite links and year references in email templates --- assets/email/template.html | 6 +++--- src/services/email/templates/accountValidation.ts | 2 +- src/services/email/templates/joinDiscord.ts | 2 +- src/services/email/templates/lastYearAnnounce.ts | 4 ++-- src/services/email/templates/minor.ts | 2 +- src/services/email/templates/orderConfirmation.ts | 4 ++-- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/assets/email/template.html b/assets/email/template.html index 38dad72b..c79a781a 100644 --- a/assets/email/template.html +++ b/assets/email/template.html @@ -6,8 +6,8 @@ - - + + UTT Arena {{& year}} - {{& title.topic}} @@ -306,7 +306,7 @@ }, { name: 'Rejoindre le serveur Discord', - location: 'https://discord.gg/WhxZwKU', + location: 'https://discord.gg/tkRrVZYXmT', }, ], ], diff --git a/src/services/email/templates/minor.ts b/src/services/email/templates/minor.ts index 242c0111..b4b78952 100644 --- a/src/services/email/templates/minor.ts +++ b/src/services/email/templates/minor.ts @@ -18,7 +18,7 @@ export const generateMinorEmail = (user: Omit) => "Tu nous as indiqué que tu seras mineur à la date de l'UTT Arena. N'oublie pas de préparer *ton autorisation parentale, et une photocopie de ta pièce d'identité, et de celle de ton responsable légal* !", "La vérification se fera à l'entrée de l'UTT Arena, n'hésite pas à envoyer à l'avance ces documents par mail à arena@utt.fr pour simplifier la procédure à l'entrée.", { - location: 'https://arena.utt.fr/uploads/files/Autorisation_parentale_-_UTT_Arena_2024.pdf', + location: 'https://arena.utt.fr/uploads/files/Autorisation_parentale_-_UTT_Arena_2025.pdf', name: "Télécharger l'autorisation parentale", }, ], diff --git a/src/services/email/templates/orderConfirmation.ts b/src/services/email/templates/orderConfirmation.ts index 6caa4e7a..3ba6cceb 100644 --- a/src/services/email/templates/orderConfirmation.ts +++ b/src/services/email/templates/orderConfirmation.ts @@ -11,7 +11,7 @@ export const generateOrderConfirmationEmail = (cart: DetailedCart) => highlight: "Bienvenue à l'UTT Arena 🔥 !", }, reason: - "Tu as reçu cet email car tu es inscrit à l'UTT Arena 2024. Si ce n'est pas le cas, contacte-nous et change le mot de passe de ta boîte mail.", + "Tu as reçu cet email car tu es inscrit à l'UTT Arena 2025. Si ce n'est pas le cas, contacte-nous et change le mot de passe de ta boîte mail.", receiver: cart.user.email, sections: [ { @@ -82,7 +82,7 @@ export const generateOrderConfirmationEmail = (cart: DetailedCart) => ], { name: 'Rejoindre le serveur Discord', - location: 'https://discord.gg/WhxZwKU', + location: 'https://discord.gg/tkRrVZYXmT', }, ], },