| | 1 | = Use-case 0012 - View Event Attendance Summary = |
| | 2 | |
| | 3 | '''Initiating actor:''' Wedding Organizer (Assistant) |
| | 4 | |
| | 5 | '''Other actors:''' Bride / Groom (Wedding owner) |
| | 6 | |
| | 7 | == Description == |
| | 8 | The organizer or wedding owner views attendance list and statistics per event, including number of attendees per role/table and overall status. |
| | 9 | |
| | 10 | == Scenario == |
| | 11 | 1. The user selects an event. |
| | 12 | 2. The system lists attendance details for all guests. |
| | 13 | |
| | 14 | {{{ |
| | 15 | SET search_path TO project; |
| | 16 | |
| | 17 | SELECT a.attendance_id, g.first_name, g.last_name, a.status, a.table_number, a.role |
| | 18 | FROM attendance a |
| | 19 | JOIN guest g ON a.guest_id = g.guest_id |
| | 20 | WHERE a.event_id = :event_id |
| | 21 | ORDER BY a.table_number NULLS LAST, g.last_name, g.first_name; |
| | 22 | }}} |
| | 23 | |
| | 24 | 3. The system shows a summary (counts by status). |
| | 25 | |
| | 26 | {{{ |
| | 27 | SET search_path TO project; |
| | 28 | |
| | 29 | SELECT status, COUNT(*) AS total |
| | 30 | FROM attendance |
| | 31 | WHERE event_id = :event_id |
| | 32 | GROUP BY status |
| | 33 | ORDER BY total DESC; |
| | 34 | }}} |
| | 35 | |
| | 36 | 4. The system can show guests per table (optional view). |
| | 37 | |
| | 38 | {{{ |
| | 39 | SET search_path TO project; |
| | 40 | |
| | 41 | SELECT table_number, COUNT(*) AS guests_on_table |
| | 42 | FROM attendance |
| | 43 | WHERE event_id = :event_id AND table_number IS NOT NULL |
| | 44 | GROUP BY table_number |
| | 45 | ORDER BY table_number; |
| | 46 | }}} |