Changes between Version 2 and Version 3 of EnrollingCourse
- Timestamp:
- 01/22/26 03:35:36 (16 hours ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
EnrollingCourse
v2 v3 3 3 ==== Actors: **Registered User (USER)** 4 4 5 **1.** A logged-in user selects a course. 6 7 **2.** The system verifies that the user has an active subscription. 8 9 **3.** An enrollment record is created. 5 **1.** Verify Active Subscription. 10 6 11 7 12 8 {{{#!sql 13 INSERT INTO enrollment (user_id, course_id, enroll_date, completion_status, progress_percentage) 14 VALUES (1, 3, CURRENT_DATE, 'IN_PROGRESS', 0); 9 SELECT 1 10 FROM user_subscription 11 WHERE user_id = :userId 12 AND status = 'ACTIVE' 13 AND end_date >= CURRENT_DATE; 14 15 }}} 15 16 16 17 18 **2.** Check Existing Enrollment. 19 20 21 {{{#!sql 22 SELECT 1 23 FROM enrollment 24 WHERE user_id = :userId 25 AND course_id = :courseId; 26 17 27 }}} 28 29 30 **3.** Create Enrollment Record. 31 32 33 {{{#!sql 34 INSERT INTO enrollment ( user_id, course_id, enroll_date, completion_status, progress_percentage) 35 VALUES ( :userId, :courseId, CURRENT_DATE, 'IN_PROGRESS', 0); 36 37 }}}
