Service Layer medium complexity mobilebackend
0
Dependencies
0
Dependents
4
Entities
0
Integrations

Description

Core business logic service orchestrating the full enrollment lifecycle. Validates prerequisite completion and seat availability before writing to the database, returns typed error states for full courses or unmet prerequisites, and wires into the Push Notification Gateway to dispatch confirmation notifications on success.

Feature: Course Enrollment Management

course-enrollment-service

Responsibilities

  • Validate prerequisite certifications before allowing enrollment
  • Check real-time seat availability to prevent overbooking
  • Write enrollment record to Supabase with row-level security enforcement
  • Dispatch confirmation push notification on successful enrollment
  • Return structured error states for validation failures

Interfaces

enrollUserInCourse(userId, courseId)
checkPrerequisites(userId, courseId)
checkSeatAvailability(courseId)
cancelEnrollment(userId, courseId)
getEnrollmentStatus(userId, courseId)
getUserEnrollments(userId)
getUpcomingEnrollments(userId)