Repository navigation
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
src/courses/course.controller.tshad grown to 1,471 lines and 53 endpoints covering every course feature. This PR moves the endpoints into controllers that live next to the feature folders that already hold their services.CourseControllerkeeps only the core course endpoints: reading, creating and updating a course, its media, trailer, certificate flag, settings and lesson sequence.catalog/course-catalog.controller.tsdashboard/course-learner-dashboard.controller.ts:courseId/open,:courseId/repeatenrollment/course-enrollment.controller.ts:courseId/students, enroll-course, enroll-courses, enroll-groups-to-course, unenroll-groups-from-course, unenroll-courseauthoring/course-bulk-editing.controller.tsauthoring/course-deletion.controller.tsduplication/course-duplication.controller.ts:courseId/duplicate, duplication-jobslearning-mode/course-student-mode.controller.ts:courseId/student-modestatistics/course-statistics.controller.ts:courseId/statistics/*endpointslanguages/course-translation.controller.tsscorm-export/course-scorm-export.controller.ts:courseId/scorm-exportownership/course-ownership.controller.tsmaster-course/master-course.controller.tsWhat stays the same:
/api/course.@Validateschemas, guards, pipes and handler bodies are moved unchanged.operationId(@ApiOperation({ operationId: "CourseController_<method>" })). The Swagger schema andgenerated-api.tsmethod names stay the same, soapps/webneeds no changes.Tests added before the move, for the two endpoints that had no HTTP-level test:
POST /api/course/:courseId/repeat: starts a repetition for a learner who completed the course, and answers 400courseRepetition.errors.unavailableotherwise.GET /api/course/:courseId/statistics/learning-time-filter-options: a group manager is offered only the groups they manage; an admin is offered every group with learners in the course.Business Value
No user-facing change. Course endpoints become easier to find and review, and changes to different course features stop conflicting in one 1,500-line file.
PR flow video
Video skipped for
8629abcefea9.This PR only splits the course controller into feature controllers and adds tests; routes, handlers and generated client names are unchanged, so nothing new is visible in the browser.