Student Course Management API
Student Course Management API – Enrollment Service
📋 Features in Current Enrollment System
🎯 Enrollment Management
- Enroll a Student
- Validates that the student exists
- Validates that the course exists and is active
- Checks if the course has available seats
- Prevents duplicate enrollment for the same student and course
- (Insert into DB pending)
- Cancel an Enrollment
- Soft-deletes an enrollment by setting
IsActive = false
🔍 Validation & Checks (Internal Logic)
- IsStudentExistsAsync → Confirms the student ID exists in the
Students
table
- IsCourseExistsAsync → Confirms the course ID exists and is active in the
Courses
table
- IsAlreadyEnrolledAsync → Ensures the student is not already actively enrolled in the course
- IsEnrollmentVacancyOpenAsync → Combines course existence and capacity checks to determine if enrollment is possible
📅 Enrollment Date Validation
– ** IsEnrollmentDateValidAsync → Confirms EnrollmentDate is between Course EnrollmentStartTime and EndTime
📊 Course Capacity Logic
- GetCapacityOfCourseAsync → Retrieves the maximum allowed number of students for a course
- GetNumberOfStudentsInCourseAsync → Counts active enrollments in a course
- Vacancy Check → Returns
true
only if the course exists and has available seats