Changes between Version 2 and Version 3 of EnrollingCourse


Ignore:
Timestamp:
01/22/26 03:35:36 (16 hours ago)
Author:
221296
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • EnrollingCourse

    v2 v3  
    33==== Actors: **Registered User (USER)**
    44
    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.
    106
    117
    128{{{#!sql
    13 INSERT INTO enrollment (user_id, course_id, enroll_date, completion_status, progress_percentage)
    14 VALUES (1, 3, CURRENT_DATE, 'IN_PROGRESS', 0);
     9SELECT 1
     10FROM user_subscription
     11WHERE user_id = :userId
     12  AND status = 'ACTIVE'
     13  AND end_date >= CURRENT_DATE;
     14
     15}}}
    1516
    1617
     18**2.** Check Existing Enrollment.
     19
     20
     21{{{#!sql
     22SELECT 1
     23FROM enrollment
     24WHERE user_id = :userId
     25  AND course_id = :courseId;
     26
    1727}}}
     28
     29
     30**3.** Create Enrollment Record.
     31
     32
     33{{{#!sql
     34INSERT INTO enrollment ( user_id, course_id, enroll_date, completion_status, progress_percentage)
     35VALUES ( :userId, :courseId, CURRENT_DATE, 'IN_PROGRESS', 0);
     36
     37}}}