Data Layer medium complexity mobilebackend
0
Dependencies
0
Dependents
2
Entities
0
Integrations

Description

Data access layer backed by Supabase tables for courses and course_enrollments. Implements row-level security so users can only enroll themselves unless they hold a coordinator role. Provides reactive streams for real-time seat availability updates via Supabase's real-time subscriptions.

Feature: Course Enrollment Management

course-repository

Responsibilities

  • CRUD operations on courses and course_enrollments tables
  • Enforce row-level security for self-enrollment and coordinator overrides
  • Provide real-time streams for seat availability changes
  • Query enrollment records filtered by user and status

Interfaces

getCourses(filters?)
getCourseById(courseId)
createEnrollment(userId, courseId)
deleteEnrollment(userId, courseId)
getEnrollmentByUserAndCourse(userId, courseId)
getEnrollmentsByUser(userId)
watchCourseAvailability(courseId)
getCoursesWithEnrollmentStatus(userId)
countEnrollments(courseId)

Related Data Entities (2)

Data entities managed by this component