| | 1 | = UC0008 - Volunteer for Event Session = |
| | 2 | |
| | 3 | '''Initiating actor:''' Member |
| | 4 | |
| | 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. |
| | 6 | |
| | 7 | == Scenario == |
| | 8 | |
| | 9 | 1. The Member opens the volunteer opportunities for Job Fair 2026. |
| | 10 | |
| | 11 | 2. The application lists event sessions and volunteer coverage. |
| | 12 | |
| | 13 | {{{#!sql |
| | 14 | SELECT |
| | 15 | es.est_name, |
| | 16 | es.es_start_time, |
| | 17 | es.location, |
| | 18 | es.es_title, |
| | 19 | est.needed_no_volunteers, |
| | 20 | COUNT(v.student_index) AS assigned_volunteers, |
| | 21 | GREATEST(est.needed_no_volunteers - COUNT(v.student_index), 0) AS missing_volunteers |
| | 22 | FROM event_sessions es |
| | 23 | JOIN event_session_types est |
| | 24 | ON est.est_name = es.est_name |
| | 25 | LEFT 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' |
| | 35 | GROUP BY |
| | 36 | es.est_name, |
| | 37 | es.es_start_time, |
| | 38 | es.location, |
| | 39 | es.es_title, |
| | 40 | est.needed_no_volunteers |
| | 41 | ORDER BY es.es_start_time, es.location, es.est_name; |
| | 42 | }}} |
| | 43 | |
| | 44 | 3. The Member chooses the Company Stands session at MFS. |
| | 45 | |
| | 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. |
| | 62 | |
| | 63 | {{{#!sql |
| | 64 | INSERT INTO volunteers ( |
| | 65 | student_index, |
| | 66 | et_name, |
| | 67 | event_title, |
| | 68 | event_start_time, |
| | 69 | est_name, |
| | 70 | es_start_time, |
| | 71 | location, |
| | 72 | volunteer_role |
| | 73 | ) |
| | 74 | VALUES ( |
| | 75 | 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', |
| | 82 | 'stand support' |
| | 83 | ); |
| | 84 | }}} |
| | 85 | |
| | 86 | 6. The application refreshes the volunteer list for the selected session. |
| | 87 | |
| | 88 | {{{#!sql |
| | 89 | SELECT |
| | 90 | v.student_index, |
| | 91 | s.first_name, |
| | 92 | s.last_name, |
| | 93 | v.volunteer_role |
| | 94 | FROM volunteers v |
| | 95 | JOIN students s |
| | 96 | 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' |
| | 103 | ORDER BY s.last_name, s.first_name; |
| | 104 | }}} |