Skip to content

Conversation

@apalchys
Copy link
Member

Pull Request Guidelines

Issue:
N/A

Description:
Migrating routes from server/ to nestjs/

Self-Check:

  • Database migration added (if required)
  • Changes tested locally

Copy link

Copilot AI left a 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[],
Copy link

Copilot AI Oct 23, 2025

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.

Suggested change
@Query('ids', new ParseArrayPipe({ items: Array<number>, optional: true })) ids: number[],
@Query('ids', new ParseArrayPipe({ items: Number, optional: true })) ids: number[],

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants