Skip to content

feat(courses): add GET /api/v1/courses/:id/syllabus endpoint (#373) - #457

Merged
DeFiVC merged 1 commit into
ChainLearnOfficial:mainfrom
ZacLou:feat/course-syllabus-issue-373
Sep 2, 2026
Merged

feat(courses): add GET /api/v1/courses/:id/syllabus endpoint (#373)#457
DeFiVC merged 1 commit into
ChainLearnOfficial:mainfrom
ZacLou:feat/course-syllabus-issue-373

Conversation

@ZacLou

@ZacLou ZacLou commented Sep 2, 2026

Copy link
Copy Markdown

Summary

Add a GET /api/v1/courses/:id/syllabus endpoint that returns the full course syllabus — module order, title, description, estimated duration, and learning objectives — as requested in #373.

What changed

  • course.types.ts: Added SyllabusModule and CourseSyllabus interfaces.
  • course.service.ts: Added getSyllabus(courseId) — builds an ordered module list from courses.courseModules jsonb (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: Added syllabus() controller method (thin passthrough).
  • course.routes.ts: Registered GET /:id/syllabus with courseIdParamsSchema validation and Swagger documentation.

Acceptance criteria checklist

  • Returns complete syllabus with descriptions
  • Includes estimated duration per module
  • Shows learning objectives (derived from quiz question prompts)
  • Cached for 5 minutes

Technical notes

  • Module data comes from courseModules jsonb (priority) or falls back to quiz moduleId groups — same fallback strategy getCourseDetail already uses.
  • Learning objectives are derived from quiz question prompts where available; modules without quizzes return an empty learningObjectives array.
  • totalEstimatedDurationMinutes is null when no module has a duration set, otherwise the sum of all module durations.

Closes #373

…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
@DeFiVC
DeFiVC merged commit 3aed2bb into ChainLearnOfficial:main Sep 2, 2026
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.

. Add GET /api/v1/courses/:id/syllabus endpoint

2 participants