-
-
Notifications
You must be signed in to change notification settings - Fork 220
feat: migrate checks to NestJS #2857
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
base: master
Are you sure you want to change the base?
Conversation
25633b2 to
9bdfe63
Compare
9bdfe63 to
910d93a
Compare
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.
Pull Request Overview
This PR migrates check-related routes from the legacy server/ directory to the NestJS framework. The migration adds new API endpoints for retrieving bad comment checkers and max score checkers, updates the OpenAPI specification, and refactors the client-side code to use the new API.
Key changes:
- Added new NestJS endpoints for course task check validations (bad comments and max score checkers)
- Migrated client services from legacy axios to generated API client
- Updated TypeScript and typescript-eslint versions
Reviewed Changes
Copilot reviewed 19 out of 20 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| package.json | Updates TypeScript tooling to newer versions |
| nestjs/src/spec.json | Adds OpenAPI specifications for new check endpoints and CourseAggregateStatsDto |
| nestjs/src/courses/task-verifications/task-verifications.service.ts | Improves type safety by moving type assertion to filter result |
| nestjs/src/courses/stats/dto/course-stats.dto.ts | Adds explicit type annotation for courseTasks array property |
| nestjs/src/courses/stats/course-stats.controller.ts | Adds API query decorators and fixes ParseArrayPipe type parameter |
| nestjs/src/courses/courses.module.ts | Registers new CourseTaskChecksService provider |
| nestjs/src/courses/course-tasks/index.ts | Exports new CourseTaskChecksService |
| nestjs/src/courses/course-tasks/dto/max-score-checker.dto.ts | Defines DTO for max score checker data |
| nestjs/src/courses/course-tasks/dto/index.ts | Exports new DTOs |
| nestjs/src/courses/course-tasks/dto/bad-comment-checker.dto.ts | Defines DTO for bad comment checker data |
| nestjs/src/courses/course-tasks/course-tasks.controller.ts | Adds new endpoints for retrieving check validation data |
| nestjs/src/courses/course-tasks/course-task-checks.service.ts | Implements business logic for check validations |
| client/src/services/check.ts | Simplifies service to use generated API client |
| client/src/modules/CrossCheckPairs/components/BadReview/BadReviewTable.tsx | Updates to use new DTO types and removes unused column |
| client/src/modules/CrossCheckPairs/components/BadReview/BadReviewControllers.tsx | Refactors to use hooks-based API calls |
| client/src/modules/CourseStatistics/hooks/useCourseStats.tsx | Updates to use CourseAggregateStatsDto type |
| client/src/modules/CourseStatistics/components/StatCards/StatCards.tsx | Updates to use CourseAggregateStatsDto type |
| client/src/api/index.ts | Adds eslint-disable comment |
| client/src/api/api.ts | Adds new DTOs and updates API method signatures (generated code) |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| public async getCoursesStats( | ||
| @Req() req: CurrentRequest, | ||
| @Query('ids', new ParseArrayPipe({ items: Number, optional: true })) ids: number[], | ||
| @Query('ids', new ParseArrayPipe({ items: Array<number>, optional: true })) ids: number[], |
Copilot
AI
Oct 23, 2025
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.
The items property should be set to Number (the constructor), not Array<number> (the type). This will cause a runtime error as ParseArrayPipe expects a constructor function to parse each item.
| @Query('ids', new ParseArrayPipe({ items: Array<number>, optional: true })) ids: number[], | |
| @Query('ids', new ParseArrayPipe({ items: Number, optional: true })) ids: number[], |
Pull Request Guidelines
Issue:
N/A
Description:
Migrating routes from
server/tonestjs/Self-Check: