Skip to content

feat: Implement enrollment system#131

Merged
azapg merged 2 commits intoazapg:mainfrom
Vedag812:main
Feb 14, 2026
Merged

feat: Implement enrollment system#131
azapg merged 2 commits intoazapg:mainfrom
Vedag812:main

Conversation

@Vedag812
Copy link
Copy Markdown
Contributor

What

Implements the enrollment feature to manage student course enrollments, as described in the issue.

Changes

  • New Enrollment model with user_id, course_id, enrolled_at and unique constraint
  • CRUD API at /api/enrollments (create, bulk create, list, delete)
  • Updated courses.py — students now see only courses they're enrolled in
  • Updated assignments.py — students see assignments from enrolled courses only
  • Updated artifact_manager.py — can_view checks enrollment status
  • Alembic migration to create the enrollments table
  • 14 tests covering CRUD, visibility, and permission checks

How to test

python -m pytest tests/test_enrollments.py -v
alembic upgrade head

… course_id, enrolled_at) - Add enrollment CRUD API endpoints (POST, GET, DELETE, bulk) - Update course endpoints to check enrollment for students - Update assignment endpoints to check enrollment - Update artifact permission system to verify enrollment - Create database migration for enrollments table - Add 14 comprehensive tests for enrollment feature
Copy link
Copy Markdown
Owner

@azapg azapg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @Vedag812! Good work, I left some review comments, mostly asking for two changes: Using the actual EnrollmentRead object for responses, and allowing all users to be enrolled into courses!

@Vedag812
Copy link
Copy Markdown
Contributor Author

Hey @Vedag812! Good work, I left some review comments, mostly asking for two changes: Using the actual EnrollmentRead object for responses, and allowing all users to be enrolled into courses!

sure will update it

…d model - Remove student-only role check (allow all users to be enrolled) - Return EnrollmentRead instances instead of raw dicts for proper alias serialization - Applied to create_enrollment, bulk_create_enrollments, and list_enrollments
@Vedag812 Vedag812 requested a review from azapg February 14, 2026 17:42
@azapg azapg linked an issue Feb 14, 2026 that may be closed by this pull request
6 tasks
@azapg
Copy link
Copy Markdown
Owner

azapg commented Feb 14, 2026

All good @Vedag812! I'm merging now!

@azapg
Copy link
Copy Markdown
Owner

azapg commented Feb 14, 2026

thank you 🫶

@azapg azapg merged commit b5a851a into azapg:main Feb 14, 2026
2 checks passed
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.

epic: Implement enrollment system for course access control

2 participants