- 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
- Soft-deletes an enrollment by setting
- 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
-- ** IsEnrollmentDateValidAsync → Confirms EnrollmentDate is between Course EnrollmentStartTime and EndTime
- 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