Skip to content

Feat/ue comment report#100

Closed
cookkydn wants to merge 108 commits intodevfrom
feat/ue-comment-report
Closed

Feat/ue comment report#100
cookkydn wants to merge 108 commits intodevfrom
feat/ue-comment-report

Conversation

@cookkydn
Copy link
Copy Markdown
Contributor

Report de commentaires

Ajout des routes pour signaler un commentaire/une réponse de commentaire, lister les commentaires signalés, traiter un signalement, récupérer la liste des raisons de signalement.
Implémente l'api pour #53

Fonctionnalités

Changement du schéma de la DB:

UeComment:

  • Suppression de lastValidatedBody & validatedAt

UeCommentReport & UeCommentReplyReport:

  • Ajout de reportedBody

Exceptions

  • Ajout de NO_SUCH_REPORT & NO_SUCH_REPORT_REASON

Routes

Ajout de:

  • Post {commentId}/report → Signaler un commentaire
  • Post reply/{replyId}/report → Signaler une réponse de commentaire
  • Get /reports → Récupérer la liste des commentaires signalés ou avec des réponses signalées
  • Patch {commentId}/{reportId} → Marquer un signalement de commentaire comme traité
  • Patch /reply/{replyId}/{reportId} → Marquer un signalement de réponse de commentaire comme traité

ThomasRitaine and others added 30 commits April 1, 2023 16:38
🐳 (Setup) Rework of the docker environment
style(npm install): 🔊 Add loglevel to track npm install process
✨ Add JWT Auth + Add end to end tests + Add swagger doc
refactor(Prisma): ♻️ Fix Translation relations + Accept data loss during database prototyping
* Update README.md

Added section for manual setup

* Update README.md

* Update README.md

* fix: some things in the readme

* fix: title levels

* fix: added back the documentation url
* * Added routes GET /profile and POST /profile to get and change your personal informations
* Renamed file .env.example to .env.dist
* Added 2 new environment variables : JWT_SECRET and JWT_EXPIRES_IN
* A UserInfos field is now created at the creation of a User. That means that you now have to specify the sex and the birthday of the User you are creating in the route
* The field UserInfos.avatar (in the database) was required. It now is still required, but has a default value (which will need to be changed)

* * Added tests for profile
* Fixed some minor bugs

* * Fixed problems with multiple .env files. Now the main .env file is called .env.dev

* changed a lot of things, added tests, added users routes

* deps: updated dependencies

* deps: set typescript back to 4.9
* feat: added a route to check if the token is valid

* feat : added new route GET /auth/signin

* fix: tests

* fix: lint

---------

Co-authored-by: AlbanSdl <alban.delavoreille@free.fr>
* ✨ Add seeding for Users.

* Ajout des modifications proposées par Thomas.

* Fix typo

* Functional seeding for UE, UTTBranches, UTTFilieres and Translation.

* Apply changes suggested by Thomas.

* Rename models to factories because it makes more sense.

* Add seed to Faker

* fix: pnpm-lock was not meant to be removed

* fix: fixed a bug in ue seeding and added back database dropping on reset

---------

Co-authored-by: BERGERAT Hugo <hugo.bergerat@loria.fr>
Co-authored-by: Teddy Roncin <teddy.roncin@proton.me>
* docs: added .readthedocs.yaml file

* docs: added requirements.txt

* Create docs/conf.py

* Create docs/index.md
* new features

* fix: revert absolute paths

* fix previous tests

* fix tests for the first route (1/12)

* add more tests

* tests: add tests for criteria

* add interfaces, typings and selectors for ue types

* test: one more test

* test: more test

* test: forgot one test

* tests: add test for comment posting

* test: add more tests

* fix: add last tests

* removed all before alls

* tests: add tests to check for uuid format

* fix merge

* test: fix test coverage

* add typing for @getuser decorator
* add missing test
* add common typed create ue function for tests

* test: add shortcuts for Spec#expectJsonLike

* experiment(test+errors): add custom errors on http 400 and 401

* add custom assertions to pactum. At this point, custom assertions only concern AppExceptions and UE-relative objects

* fix: add more details in custom http 400 errors

* test: end tests

* docs is still missing

* fix: add incode docs and comments

* fix(ue): use ue.code instead of ue.inscriptionCode

* fix: renames, update upvote routes

* fix: replace UE by ue in database schema
…10)

* feat: added tables to support incredible timetables in schema.prisma

* feat: added a timetable service

* added prettier in .eslintrc
* updated .prettierrc
* updated dependencies
* removed startHour and endHour, replacing them by occurenceDuration
* updated typing for database models

* fix: timetable fetching should now work (not tested)

* refactor: refactored TimetableEntry structure

* overrides are now in a separate table
* we now use less times, and more metrics based on counting occurrences, which makes for easier maths and database consistency
* starting adding support for unit testing
* started testing the TimetableService class

* fix: somes bugs + more tests

* fix: lint

* fix: data cleaning was shlag

* fix: now pnpm test does unit and e2e tests + lint + unitSuite util function

* docs: documented TimetableService

* and fixed some bugs, oupsy
* updated scripts in package.json and added scripts test:unit and test:e2e
* lint

* feat: route GET /timetable/current/daily/:day/:month/:year

* removed dependency supertest
* timetable occurrences are now sorted

* feat: added utility function sortArray

* fix: changed parameter name day to date in route GET timetable/current/daily/:day/:month/:year

* new features

* fix: revert absolute paths

* fix previous tests

* fix tests for the first route (1/12)

* add more tests

* tests: add tests for criteria

* add interfaces, typings and selectors for ue types

* test: one more test

* test: more test

* test: forgot one test

* tests: add test for comment posting

* test: add more tests

* fix: add last tests

* removed all before alls

* tests: add tests to check for uuid format

* fix merge

* feat: added route GET /timetable/current/groups

* added field createdAt in schema.prisma
* added utility test function createTimetableGroup
* utility test function createUser now automatically fakes all data

* feat: added route GET /timetable/:entryId

* feat: created function create

* that's a draft atm

* test: fix test coverage

* add typing for @getuser decorator
* add missing test
* add common typed create ue function for tests

* test: add shortcuts for Spec#expectJsonLike

* refactor: each entry (or override) can now be associated with multiple groups

* feat: added route POST /timetable/current

* feat: added route PATCH /timetable/current/:entryId

* fix: can no longer override an entry for groups that were not in the original entry

* experiment(test+errors): add custom errors on http 400 and 401

* add custom assertions to pactum. At this point, custom assertions only concern AppExceptions and UE-relative objects

* fix: add more details in custom http 400 errors

* test: end tests

* docs is still missing

* fix: tests

* feat: added route DELETE /timetable/current/:entryId

* refactor: some old tests that did not use current tools

* dependencies: upgrade + very small updates on old tests

* docs: added documentation

* fix: lint

* fix: lot of small fixes

* removed environment variables POSTGRES_USER, POSTGRES_PASSWORD, POSTGRES_DB, and added FAKER_SEED for test environment
* added file .env.test.dist for test environment
* updated commands in package.json
* changed User.RGPDId and User.RGPD to User.rgpdId and User.rgpd in schema.prisma
* now throwing AppException s instead of ForbiddenException s, NotFoundException s, ...
* removed useless @UseGuards(JwtGuard)
* removed default collect coverage when testing
* changed ES version

* feat: added a way to generate functions to create fake entities way more easily

* fix: review

* fix: added flags --runInBand in testing commands

---------

Co-authored-by: AlbanSdl <alban.delavoreille@free.fr>
TeddyRoncin and others added 13 commits September 19, 2025 09:16
* Route `POST /auth/signup/cas` creates an asso if the user provided is
an asso user
* New routes `GET /auth/permissions/current` and `GET
/auth/permissions/:apiKey`
* Small refactor of permission storage in the code (database left
unchanged)
* Improved permission managing in fakedb
add membership related features, add `expectRegexableJson` for tests, update ci
@cookkydn cookkydn linked an issue Oct 27, 2025 that may be closed by this pull request
@codecov
Copy link
Copy Markdown

codecov Bot commented Oct 28, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.94%. Comparing base (c0f3d81) to head (4381e36).

Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #100      +/-   ##
==========================================
+ Coverage   83.19%   83.94%   +0.75%     
==========================================
  Files         140      144       +4     
  Lines        2398     2492      +94     
  Branches      470      454      -16     
==========================================
+ Hits         1995     2092      +97     
+ Misses        398      395       -3     
  Partials        5        5              

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@cookkydn
Copy link
Copy Markdown
Contributor Author

Ready à review

Copy link
Copy Markdown
Member

@AlbanSdl AlbanSdl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, super PR 😁
Deux trois petits trucs à modifier et un petit coup de prettier à passer :D

Comment thread migration/etuutt_old/make-migration.ts Outdated
Comment thread src/ue/comments/dto/req/ue-comment-report-req.dto.ts
Comment thread test/e2e/profile/set-homepage-widgets.e2e-spec.ts Outdated
Comment thread test/e2e/profile/set-homepage-widgets.e2e-spec.ts Outdated
Comment thread test/e2e/ue/annals/get-annal-file.e2e-spec.ts
Comment thread test/e2e/ue/comments/update-comment-reply-report.e2e-spec.ts Outdated
Comment thread test/e2e/ue/comments/get-comment-report-reasons.e2e-spec.ts Outdated
Comment thread src/ue/comments/comments.service.ts Outdated
Comment thread src/ue/comments/comments.service.ts Outdated
Comment thread src/ue/comments/comments.service.ts Outdated
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.

Review des reports de commentaires / réponses aux commentaires

9 participants