Changes between Version 1 and Version 2 of UseCase0003


Ignore:
Timestamp:
09/02/26 20:38:05 (4 days ago)
Author:
236024
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • UseCase0003

    v1 v2  
    991. The Member opens the list of upcoming activity sessions.
    1010
    11 2. The application lists upcoming sessions with the member's current RSVP and attendance status.
     112. The application lists upcoming sessions with the member's current RSVP, attendance status, and whether attendance is expected.
    1212
    1313{{{#!sql
    1414SELECT
    15     a.at_name,
     15    a.as_id,
     16    at.at_name,
    1617    a.as_start_time,
    17     a.as_location,
    18     COALESCE(p.rsvp_status, 'no_response') AS rsvp_status,
     18    l.l_name,
     19    p.rsvp_status,
    1920    p.rsvp_at,
    20     COALESCE(p.attendance_status, 'not_checked') AS attendance_status
     21    p.attendance_status,
     22    CASE
     23        WHEN ra.student_index IS NOT NULL THEN 'yes'
     24        ELSE 'no'
     25    END AS attendance_expected
    2126FROM activity_sessions a
     27JOIN activity_types at
     28    ON at.at_id = a.at_id
     29JOIN locations l
     30    ON l.l_id = a.l_id
    2231LEFT JOIN participation p
    23     ON p.at_name = a.at_name
    24    AND p.as_start_time = a.as_start_time
    25    AND p.as_location = a.as_location
     32    ON p.as_id = a.as_id
    2633   AND p.student_index = 230014
     34LEFT JOIN required_attendance ra
     35    ON ra.as_id = a.as_id
     36   AND ra.student_index = 230014
    2737WHERE a.as_start_time >= CURRENT_TIMESTAMP
    28 ORDER BY a.as_start_time, a.at_name;
     38ORDER BY a.as_start_time, at.at_name;
    2939}}}
    3040
     
    3646INSERT INTO participation (
    3747    student_index,
    38     at_name,
    39     as_start_time,
    40     as_location,
     48    as_id,
    4149    rsvp_status,
    42     rsvp_at,
    43     attendance_status
     50    rsvp_at
    4451)
    4552VALUES (
    4653    230014,
    47     'IT Workshop',
    48     TIMESTAMP '2026-11-26 17:00:00',
    49     'Base42',
     54    22,
    5055    'going',
    51     CURRENT_TIMESTAMP,
    52     'not_checked'
     56    CURRENT_TIMESTAMP
    5357);
    5458}}}
    5559
    56 5. The Member enters an absence reason for the Hackathon core team meeting.
     605. The Member enters an absence reason for the Full Member Meeting on 16 April 2026.
    5761
    58 6. The application stores the absence announcement.
     626. The application checks that the member's attendance is expected for the selected activity session.
     63
     64{{{#!sql
     65SELECT
     66    student_index,
     67    as_id
     68FROM required_attendance
     69WHERE student_index = 230014
     70  AND as_id = 9;
     71}}}
     72
     737. The application stores the absence announcement.
    5974
    6075{{{#!sql
    6176INSERT INTO announces_absence (
    6277    student_index,
    63     at_name,
    64     as_start_time,
    65     as_location,
     78    as_id,
    6679    reason,
    6780    announced_at
     
    6982VALUES (
    7083    230014,
    71     'Core Team Meeting',
    72     TIMESTAMP '2026-12-01 18:30:00',
    73     'BEST Office',
     84    9,
    7485    'Faculty obligations at the same time.',
    7586    CURRENT_TIMESTAMP
     
    7788}}}
    7889
    79 7. The application updates the participation status for the same session.
     908. The application stores that the member is not going to the same activity session.
    8091
    8192{{{#!sql
    82 UPDATE participation
    83 SET
    84     rsvp_status = 'not_going',
    85     rsvp_at = CURRENT_TIMESTAMP,
    86     attendance_status = 'excused'
    87 WHERE student_index = 230014
    88   AND at_name = 'Core Team Meeting'
    89   AND as_start_time = TIMESTAMP '2026-12-01 18:30:00'
    90   AND as_location = 'BEST Office';
     93INSERT INTO participation (
     94    student_index,
     95    as_id,
     96    rsvp_status,
     97    rsvp_at
     98)
     99VALUES (
     100    230014,
     101    9,
     102    'not_going',
     103    CURRENT_TIMESTAMP
     104);
    91105}}}
    92106
    93 8. The application shows the saved absence and updated participation status.
     1079. The application shows the saved absence and participation status.
    94108
    95109{{{#!sql
    96110SELECT
    97111    p.student_index,
    98     p.at_name,
    99     p.as_start_time,
    100     p.as_location,
     112    at.at_name,
     113    a.as_start_time,
     114    l.l_name,
    101115    p.rsvp_status,
    102116    p.rsvp_at,
     
    105119    aa.announced_at
    106120FROM participation p
     121JOIN activity_sessions a
     122    ON a.as_id = p.as_id
     123JOIN activity_types at
     124    ON at.at_id = a.at_id
     125JOIN locations l
     126    ON l.l_id = a.l_id
    107127LEFT JOIN announces_absence aa
    108128    ON aa.student_index = p.student_index
    109    AND aa.at_name = p.at_name
    110    AND aa.as_start_time = p.as_start_time
    111    AND aa.as_location = p.as_location
     129   AND aa.as_id = p.as_id
    112130WHERE p.student_index = 230014
    113   AND p.at_name = 'Core Team Meeting'
    114   AND p.as_start_time = TIMESTAMP '2026-12-01 18:30:00'
    115   AND p.as_location = 'BEST Office';
     131  AND p.as_id = 9;
    116132}}}