fix: repair broken build from #344-#347 merge - #444
Merged
DeFiVC merged 1 commit intoAug 31, 2026
Merged
Conversation
…ial#347 merge that blocked the entire build fea2b78 ("Add user ban, activity, batch enroll, and learning path endpoints (ChainLearnOfficial#344, ChainLearnOfficial#345, ChainLearnOfficial#346, ChainLearnOfficial#347)") left the codebase in a non-compiling state — `npm run build` currently fails on `main`: - src/modules/courses/course.routes.ts: the /enroll/batch route registration was missing its closing `);`, so the next app.get(...) call became part of its argument list — unparseable. - src/modules/users/user.routes.ts: same mistake on the /me/learning-path route — missing `);` before the next app.get(...). - src/modules/admin/admin-users.service.ts: an extra `}` closed AdminUsersService right after listUsers(), so banUser() and getUserActivity() ended up declared as free-floating methods outside any class body. `npm run build` (tsc) and `npm run typecheck` (tsc --noEmit -p tsconfig.test.json, src/ portion) both pass clean after this. The remaining tsconfig.test.json errors are pre-existing loosely-typed test mocks scattered across several unrelated test files (stellar, sep10-auth, retry-queue, idempotency, tracing, concurrent-safety) — untouched by fea2b78, not build-blocking, and out of scope here.
|
Hey @codemagician1949! 👋 It looks like this PR isn't linked to any issue. If this PR is for one of the issues assigned to you as part of a Wave, please link it to ensure your contribution is tracked properly. You can do this by adding a keyword to the PR description (e.g.,
|
DeFiVC
pushed a commit
that referenced
this pull request
Aug 31, 2026
…port #354 — GET /api/v1/courses/:id/prerequisites - courses.prerequisites: jsonb string[] column (migration 0020), admin-configurable via existing POST/PUT /admin/courses (self-reference filtered out on update) - CourseService.getCoursePrerequisites(): resolves configured prerequisite courses, annotates each with the caller's completion status (enrollments.completedAt IS NOT NULL), returns an overall met flag. Anonymous callers see every prerequisite as incomplete. #353 — POST/GET/PUT/DELETE /api/v1/admin/announcements + GET /api/v1/announcements - New announcements table (migration 0021): title, message, priority (normal/high/urgent), active, createdAt, expiresAt - New module (src/modules/announcements/): full admin CRUD (authGuard+adminGuard) plus a public GET that filters to active && (no expiry || expiry in the future) #367 — GET /api/v1/admin/dashboard - New module (src/modules/admin/dashboard.*): total users, new users (today/week/month), total enrollments, quiz completion rate (graded / total submissions), total credentials, total rewards claimed (SUM(rewardAmount) where claimed), plus week-over-week trend comparisons for new users and enrollments. Cached 5 minutes via the existing cache/index.ts helpers. Admin only. #366 — POST /api/v1/admin/courses/import - Accepts multipart/form-data with one JSON file part (reuses the already-registered @fastify/multipart), validates against a Zod schema (core course fields + an optional modules array), creates the course via the existing createCourse() path, then creates each module via the existing createModule() so IDs/locking/audit/cache-invalidation all match a manually-created module. Returns { courseId, modulesCreated }. Note: the issue's literal route was /admin/courses/:id/import, but its own scope/acceptance-criteria describe creating a *new* course from the file ("creates the course... returns the created course ID") — a target :id doesn't fit that, so implemented as the collection-level /admin/courses/import instead. Flagged for review below. Also included: a standalone build fix (see PR #444) this branch is based on top of, since course.routes.ts (one of the files #354/#366 touch) had a syntax error blocking the whole build. Verification: npm run build (tsc) is clean. Did not add new automated tests for these four endpoints given time constraints — flagging that honestly rather than claiming coverage that isn't there. Existing courses/admin test suites still reference the same service methods these changes extend (createCourse, createModule, toAdminCourse), so a schema/behavior regression there would likely surface on the existing suite even without new tests, but the new logic itself (prerequisite resolution, announcement active-filtering, dashboard aggregates, import parsing) has no dedicated coverage yet. Closes #354 Closes #353 Closes #367 Closes #366
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.
Problem
maincurrently does not build.fea2b78("Add user ban, activity, batch enroll, and learning path endpoints (#344, #345, #346, #347)") left three syntax errors behind:src/modules/courses/course.routes.ts— thePOST /enroll/batchroute registration is missing its closing);, so the followingapp.get(...)call for/:id/reviewsbecomes part of its argument list.src/modules/users/user.routes.ts— same mistake onGET /me/learning-path, missing);before the nextapp.get(...)for/me/notifications.src/modules/admin/admin-users.service.ts— an extra}closesAdminUsersServiceright afterlistUsers(), sobanUser()andgetUserActivity()end up declared outside any class body.Fix
Added the two missing
);and removed the extra}— no behavioral changes, purely restoring valid syntax to what was clearly intended.Verification
npm run build(tsc) — clean, was previously failing to even parse these files.npm run typecheck(tsc --noEmit -p tsconfig.test.json) — thesrc/portion is now clean. The remaining errors are pre-existing loosely-typed test mocks in several unrelated test files (stellar, sep10-auth, retry-queue, idempotency, tracing, concurrent-safety) — not touched byfea2b78, not build-blocking, left out of scope for this PR.Found this while starting on a separate issue batch that touches
course.routes.ts— opening standalone since it blocks the build for everyone, not just that work.