Repository navigation
feat(academy): learner progress tracking and certificates (BE-038) - #889
Merged
MaryammAli merged 2 commits intoSep 26, 2026
Merged
MaryammAli merged 2 commits into
MaryammAli merged 2 commits into
Conversation
Add ProgressModule/ProgressService for per-learner lesson and task completion, per-course XP and dashboard aggregation, and the completion transition that issues certificate eligibility. Reuses the existing DomainEventBus/XpService so task.passed and course.completed XP are priced in one place.
|
@abiolatousin-design Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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
Adds per-learner progress tracking to
BackendAcademy: lesson and taskcompletion counts and percentages, XP earned per course, an aggregate endpoint
for the dashboard, and the transition that marks a course complete — which is
what makes the learner eligible for a certificate.
The new
ProgressServicefollows the academy's existing service pattern(in-memory state, like
XpServiceandFollowService) and reuses theDomainEventBus/XpServicethat already exist inGamificationModuleinstead of pricing XP itself: finishing a task publishes
task.passedandcompleting a course publishes
course.completed, so XP stays in one place.xpEarnedper course is read back from that ledger bycourseId.Related Issue
Implements the per-learner progress tracking described in #791 (BE-038), under
the Learning Academy backlog area and the
BackendAcademyscope.Changes
[ADD]
BackendAcademy/src/progress/progress.types.tsCourseContent(lesson/task manifest),CourseCompletion,CertificateEligibility,LearnerCourseProgressandLearnerDashboard.[ADD]
BackendAcademy/src/progress/progress.service.tslessons or no tasks, since it could never be completed).
completeLesson()/completeTask()record completion and return refreshedcourse progress; a repeated completion is rejected with
BadRequestException.evaluateCompletion()flips the course to complete exactly once, when everylesson and task is done, then publishes
course.completedand records aCertificateEligibility.getCourseProgress()returns completion counts, rounded percentages andper-course
xpEarned;getDashboard()aggregates courses, total XP andcertificates for a learner;
listCertificates()/getCertificate()exposecertificate eligibility.
[ADD]
BackendAcademy/src/progress/progress.controller.tsPOST /api/v1/progress/courses— register a course manifest.POST /api/v1/progress/lessons/complete— mark a lesson complete.POST /api/v1/progress/tasks/complete— mark a task complete (awards XP).GET /api/v1/progress/users/:userId/courses/:courseId— one course.GET /api/v1/progress/users/:userId/dashboard— aggregate dashboard payload.GET /api/v1/progress/users/:userId/certificates— certificate eligibility.[ADD]
BackendAcademy/src/progress/dto/{register-course,complete-lesson,complete-task}.dto.tsforbidNonWhitelistedglobal validation.[ADD]
BackendAcademy/src/progress/progress.module.tsGamificationModuleso completions publish on the shared event bus.[ADD]
BackendAcademy/src/progress/progress.service.spec.tssingle-award idempotency, dashboard aggregation and error cases.
[ADD]
BackendAcademy/test/progress.e2e-spec.tsProgressModule.[MODIFY]
BackendAcademy/src/app.module.tsProgressModule.[MODIFY]
BackendAcademy/README.mdprogressmodule.Verification Results
lessonCompletionPercentonLearnerCourseProgresstasksCompleted/tasksTotal/taskCompletionPercentxpEarned, read from the existing XP ledger bycourseIdGET /api/v1/progress/users/:userId/dashboardevaluateCompletion()transition setscompleted/completedAtCertificateEligibilityissued in the same transition and exposed via the APICloses #791