Changes between Version 2 and Version 3 of UC3001


Ignore:
Timestamp:
06/15/26 14:16:44 (4 days ago)
Author:
216009
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • UC3001

    v2 v3  
    33**Initiating actor:** Student
    44
    5 **Other actors:** Professor
     5**Other actors:** None
    66
    77**Description:**
    8 A student wants to enroll in a subject offered by their faculty. The system checks prerequisites, enrollment limits, and records the enrollment in the database.
     8A student enrolls in a subject offered by their faculty and selects a specific professor who teaches that course instance.
    99
    1010**Scenario:**
     
    12121. Student logs into the system and selects “Enroll in Subject.”
    1313
    14 2. System displays a list of subjects available for their faculty:
     142. System displays available subjects and the professors teaching them at the student's faculty:
    1515{{{
    16 SELECT s.Id, s.Name, s.Semester, s.Credits
    17 FROM Subject s 
    18 JOIN Faculty f ON s.Faculty_Id = f.Id
    19 JOIN Student st ON st.Faculty_Id = f.Id
     16SELECT s.Id AS Subject_Id, s.Name AS Subject_Name, p.Id AS Professor_Id, p.Name AS Professor_Name, p.Surname AS Professor_Surname
     17FROM Subject s
     18JOIN Professor p ON p.Faculty_Id = s.Faculty_Id
     19JOIN Student st ON st.Faculty_Id = s.Faculty_Id
    2020WHERE st.Id = :student_id;
    2121}}}
    2222
    23 3. Student chooses a subject and clicks “Enroll.”
     233. Student chooses a subject and the desired professor, then clicks “Enroll.”
    2424
    25 4. System checks if the student is already enrolled:
     254. System checks if the student is already enrolled in this subject:
    2626{{{
    2727SELECT * FROM Student_Subject
     
    2929}}}
    3030
    31 5. If not enrolled, system inserts enrollment record:
     315. If not enrolled, system inserts the enrollment record:
    3232{{{
    33 INSERT INTO Student_Subject(Student_Id, Subject_Id, Status, Enrollment_Date, Absences_Count)
    34 VALUES (:student_id, :subject_id, 'ENROLLED', CURRENT_DATE, 0);
     33INSERT INTO Student_Subject(Student_Id, Subject_Id, Professor_Id, Status, Enrollment_Date, Absences_Count)
     34VALUES (:student_id, :subject_id, :professor_id, 'PASSED', :enrollment_date, 0);
    3535}}}
    3636