Skip to content

feat(courses): reject enrollment in unpublished courses (BA-013) - #1034

Open
ranjeetprabhatedu-dotcom wants to merge 1 commit into
BlockDash-Studios:mainfrom
ranjeetprabhatedu-dotcom:feat/ba-013-unpublished-course-926
Open

ranjeetprabhatedu-dotcom wants to merge 1 commit into
BlockDash-Studios:mainfrom
ranjeetprabhatedu-dotcom:feat/ba-013-unpublished-course-926

Conversation

@ranjeetprabhatedu-dotcom

@ranjeetprabhatedu-dotcom ranjeetprabhatedu-dotcom commented Oct 14, 2026 •

Copy link
Copy Markdown

Summary

This PR addresses issue #926 (BA-013) by rejecting enrollment attempts in unpublished/draft courses with a clear 409 ConflictException.

  • Changes:
    • BackendAcademy/src/courses/course.types.ts: Added CourseStatus = "draft" | "published" and CourseNotPublishedError interface; added optional status?: CourseStatus | string field to Course.
    • BackendAcademy/src/courses/enrollment.service.ts: Enforce conflict rejection if course.status === "draft" with structured 409 ConflictException.
    • BackendAcademy/src/courses/enrollment.service.spec.ts: Added comprehensive unit tests verifying draft course rejection with 409, published course acceptance, and default status compatibility.
  • Verification:
    • All 27 tests in enrollment.service.spec.ts pass cleanly (100% Green).
    • Scope strictly restricted to the 3 allowlisted files.

Closes #926

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.

BA-013 — Reject enrollment in unpublished courses

1 participant