Course Repository
Component Detail
Data Layer
medium complexity
backend
0
Dependencies
2
Dependents
2
Entities
0
Integrations
Description
Data access layer for all course and enrollment persistence operations against the PostgreSQL database. Handles CRUD for courses and course_enrollments tables, supports queries for capacity checks, enrollment lookups by user or association, and recurrence-aware scheduling queries.
course-repository
Responsibilities
- Persist and retrieve course records with recurrence and capacity fields
- Manage course_enrollments CRUD with status transitions
- Provide enrollment count queries for capacity enforcement
Interfaces
findAllCourses(filters)
findCourseById(courseId)
createCourse(courseData)
updateCourse(courseId, updates)
deleteCourse(courseId)
createEnrollment(userId, courseId)
updateEnrollmentStatus(enrollmentId, status)
deleteEnrollment(enrollmentId)
findEnrollmentsByUser(userId)
findEnrollmentsByCourse(courseId)
findEnrollmentsByAssociation(associationId)
countEnrollmentsByCourse(courseId)
findEnrollmentByUserAndCourse(userId, courseId)
Relationships
Dependents (2)
Components that depend on this component
Related Data Entities (2)
Data entities managed by this component