| | 1 | = Use-case 0004 - Manage Guest List (Add / View Guests) = |
| | 2 | |
| | 3 | '''Initiating actor:''' Bride / Groom (Wedding owner) |
| | 4 | |
| | 5 | '''Other actors:''' None |
| | 6 | |
| | 7 | == Description == |
| | 8 | The wedding owner manages the guest list by adding guests and viewing existing guests for a specific wedding. Guests are stored in the database and linked to the wedding. |
| | 9 | |
| | 10 | == Scenario == |
| | 11 | 1. The user selects a wedding. |
| | 12 | 2. The system shows the guest list for the selected wedding. |
| | 13 | |
| | 14 | {{{ |
| | 15 | SET search_path TO project; |
| | 16 | |
| | 17 | SELECT guest_id, first_name, last_name, email |
| | 18 | FROM guest |
| | 19 | WHERE wedding_id = :wedding_id |
| | 20 | ORDER BY last_name, first_name; |
| | 21 | }}} |
| | 22 | |
| | 23 | 3. The user clicks "Add Guest". |
| | 24 | 4. The system displays a form: first name, last name, email. |
| | 25 | 5. The user submits guest information. |
| | 26 | 6. The system inserts the guest into the database. |
| | 27 | |
| | 28 | {{{ |
| | 29 | SET search_path TO project; |
| | 30 | |
| | 31 | INSERT INTO guest(first_name, last_name, email, wedding_id) |
| | 32 | VALUES (:first_name, :last_name, :email, :wedding_id) |
| | 33 | RETURNING guest_id; |
| | 34 | }}} |
| | 35 | |
| | 36 | 7. The system refreshes and shows the updated list of guests. |