Changes between Version 1 and Version 2 of UseCase0008


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

--

Legend:

Unmodified
Added
Removed
Modified
  • UseCase0008

    v1 v2  
    33'''Initiating actor:''' Member
    44
    5 A Member volunteers for a selected event session. The scenario uses Dario Petreski volunteering for the Company Stands session at MFS during Job Fair 2026.
     5A Member views event sessions that need volunteers and volunteers for one selected session.
    66
    77== Scenario ==
    88
    9 1. The Member opens the volunteer opportunities for Job Fair 2026.
     91. The Member opens the volunteer page for Job Fair 2026.
    1010
    11 2. The application lists event sessions and volunteer coverage.
     112. The application lists event sessions with the number of assigned and missing volunteers.
    1212
    1313{{{#!sql
    1414SELECT
    15     es.est_name,
     15    es.ee_id,
     16    es.es_no,
     17    est.est_name,
    1618    es.es_start_time,
    17     es.location,
     19    l.l_name,
    1820    es.es_title,
    19     est.needed_no_volunteers,
     21    es.needed_no_volunteers,
    2022    COUNT(v.student_index) AS assigned_volunteers,
    21     GREATEST(est.needed_no_volunteers - COUNT(v.student_index), 0) AS missing_volunteers
     23    GREATEST(es.needed_no_volunteers - COUNT(v.student_index), 0) AS missing_volunteers
    2224FROM event_sessions es
    2325JOIN event_session_types est
    24     ON est.est_name = es.est_name
     26    ON est.est_id = es.est_id
     27JOIN locations l
     28    ON l.l_id = es.l_id
    2529LEFT JOIN volunteers v
    26     ON v.et_name = es.et_name
    27    AND v.event_title = es.event_title
    28    AND v.event_start_time = es.event_start_time
    29    AND v.est_name = es.est_name
    30    AND v.es_start_time = es.es_start_time
    31    AND v.location = es.location
    32 WHERE es.et_name = 'Job Fair'
    33   AND es.event_title = 'Job Fair 2026'
    34   AND es.event_start_time = TIMESTAMP '2026-03-23 09:00:00'
     30    ON v.ee_id = es.ee_id
     31   AND v.es_no = es.es_no
     32WHERE es.ee_id = 4
    3533GROUP BY
    36     es.est_name,
     34    es.ee_id,
     35    es.es_no,
     36    est.est_name,
    3737    es.es_start_time,
    38     es.location,
     38    l.l_name,
    3939    es.es_title,
    40     est.needed_no_volunteers
    41 ORDER BY es.es_start_time, es.location, es.est_name;
     40    es.needed_no_volunteers
     41ORDER BY es.es_start_time, l.l_name, es.es_no;
    4242}}}
    4343
    44 3. The Member chooses the Company Stands session at MFS.
     443. The Member chooses the Engineering Companies Stands session.
    4545
    46 4. The application checks whether the member already volunteers at the same start time.
    47 
    48 {{{#!sql
    49 SELECT
    50     v.et_name,
    51     v.event_title,
    52     v.est_name,
    53     v.es_start_time,
    54     v.location,
    55     v.volunteer_role
    56 FROM volunteers v
    57 WHERE v.student_index = 230024
    58   AND v.es_start_time = TIMESTAMP '2026-03-24 10:00:00';
    59 }}}
    60 
    61 5. The application stores the volunteer record.
     464. The application stores the volunteer assignment.
    6247
    6348{{{#!sql
    6449INSERT INTO volunteers (
    6550    student_index,
    66     et_name,
    67     event_title,
    68     event_start_time,
    69     est_name,
    70     es_start_time,
    71     location,
     51    ee_id,
     52    es_no,
    7253    volunteer_role
    73 )
    74 VALUES (
     54) VALUES (
    7555    230024,
    76     'Job Fair',
    77     'Job Fair 2026',
    78     TIMESTAMP '2026-03-23 09:00:00',
    79     'Company Stands',
    80     TIMESTAMP '2026-03-24 10:00:00',
    81     'MFS',
     56    4,
     57    3,
    8258    'stand support'
    8359);
    8460}}}
    8561
    86 6. The application refreshes the volunteer list for the selected session.
     625. The application shows volunteers assigned to the selected session.
    8763
    8864{{{#!sql
     
    9167    s.first_name,
    9268    s.last_name,
     69    ee.ee_title,
     70    es.es_no,
     71    es.es_title,
    9372    v.volunteer_role
    9473FROM volunteers v
    9574JOIN students s
    9675    ON s.student_index = v.student_index
    97 WHERE v.et_name = 'Job Fair'
    98   AND v.event_title = 'Job Fair 2026'
    99   AND v.event_start_time = TIMESTAMP '2026-03-23 09:00:00'
    100   AND v.est_name = 'Company Stands'
    101   AND v.es_start_time = TIMESTAMP '2026-03-24 10:00:00'
    102   AND v.location = 'MFS'
     76JOIN event_editions ee
     77    ON ee.ee_id = v.ee_id
     78JOIN event_sessions es
     79    ON es.ee_id = v.ee_id
     80   AND es.es_no = v.es_no
     81WHERE v.ee_id = 4
     82  AND v.es_no = 3
    10383ORDER BY s.last_name, s.first_name;
    10484}}}