| | 1 | = Use-case 0003 - Create Wedding = |
| | 2 | |
| | 3 | '''Initiating actor:''' Bride / Groom (Wedding owner) |
| | 4 | |
| | 5 | '''Other actors:''' None |
| | 6 | |
| | 7 | == Description == |
| | 8 | The registered user creates a new wedding plan by defining the wedding date, budget and notes. Each wedding is connected to exactly one user (owner). |
| | 9 | |
| | 10 | == Scenario == |
| | 11 | 1. The user opens the "Create Wedding" option from the dashboard. |
| | 12 | 2. The system displays a form: wedding date, budget, notes. |
| | 13 | 3. The user enters the wedding information and submits. |
| | 14 | 4. The system inserts the new wedding in the database. |
| | 15 | |
| | 16 | {{{ |
| | 17 | SET search_path TO project; |
| | 18 | |
| | 19 | INSERT INTO wedding("date", budget, notes, user_id) |
| | 20 | VALUES (:date, :budget, :notes, :user_id) |
| | 21 | RETURNING wedding_id; |
| | 22 | }}} |
| | 23 | |
| | 24 | 5. The system confirms creation and shows the created wedding details. |
| | 25 | |
| | 26 | {{{ |
| | 27 | SET search_path TO project; |
| | 28 | |
| | 29 | SELECT wedding_id, "date", budget, notes |
| | 30 | FROM wedding |
| | 31 | WHERE wedding_id = :wedding_id; |
| | 32 | }}} |