feat(courses): add GET /api/v1/courses/:id/syllabus endpoint (#373) - #457
Merged
DeFiVC merged 1 commit intoSep 2, 2026
Merged
Conversation
…arnOfficial#373) Add a syllabus endpoint that returns the full course structure with module descriptions, estimated duration, and learning objectives. - SyllabusModule type with order/id/title/description/duration/objectives - CourseService.getSyllabus: builds ordered modules from courseModules jsonb (falls back to quiz-derived module IDs), derives learning objectives from quiz question prompts (first 5 per module), caches for 5 minutes matching the issue's acceptance criteria - CourseController.syllabus: thin passthrough - Route registered as GET /:id/syllabus with courseIdParamsSchema validation, tagged for Swagger Closes ChainLearnOfficial#373
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.
Summary
Add a
GET /api/v1/courses/:id/syllabusendpoint that returns the full course syllabus — module order, title, description, estimated duration, and learning objectives — as requested in #373.What changed
course.types.ts: AddedSyllabusModuleandCourseSyllabusinterfaces.course.service.ts: AddedgetSyllabus(courseId)— builds an ordered module list fromcourses.courseModulesjsonb (falls back to quiz-derived module IDs when rich metadata isn't present), derives learning objectives from each module's quiz question prompts (first 5 per module to keep the list focused), computes total estimated duration, and caches the result for 5 minutes per the issue's acceptance criteria.course.controller.ts: Addedsyllabus()controller method (thin passthrough).course.routes.ts: RegisteredGET /:id/syllabuswithcourseIdParamsSchemavalidation and Swagger documentation.Acceptance criteria checklist
Technical notes
courseModulesjsonb (priority) or falls back to quizmoduleIdgroups — same fallback strategygetCourseDetailalready uses.learningObjectivesarray.totalEstimatedDurationMinutesisnullwhen no module has a duration set, otherwise the sum of all module durations.Closes #373