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' }} 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 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', }, ], }, 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); 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);