| | 1 | = Use-case 0006 - Book Venue = |
| | 2 | |
| | 3 | '''Initiating actor:''' Bride / Groom (Wedding owner) |
| | 4 | |
| | 5 | '''Other actors:''' Wedding Organizer (Assistant) |
| | 6 | |
| | 7 | == Description == |
| | 8 | The user books a venue for the wedding. The venue booking includes date, start/end time, booking status and price, and connects the wedding with a chosen venue. |
| | 9 | |
| | 10 | == Scenario == |
| | 11 | 1. The user opens "Venues" and searches/selects a venue. |
| | 12 | 2. The system shows available venues with details. |
| | 13 | |
| | 14 | {{{ |
| | 15 | SET search_path TO project; |
| | 16 | |
| | 17 | SELECT v.venue_id, v.name, v.location, v.city, v.capacity, v.price_per_guest, vt.type_name |
| | 18 | FROM venue v |
| | 19 | JOIN venue_type vt ON v.type_id = vt.type_id |
| | 20 | ORDER BY v.city, v.name; |
| | 21 | }}} |
| | 22 | |
| | 23 | 3. The user selects a venue and clicks "Book". |
| | 24 | 4. The system displays booking form: date, start_time, end_time, status, price. |
| | 25 | 5. The user submits booking. |
| | 26 | 6. The system inserts the booking into database. |
| | 27 | |
| | 28 | {{{ |
| | 29 | SET search_path TO project; |
| | 30 | |
| | 31 | INSERT INTO venue_booking("date", start_time, end_time, status, price, venue_id, wedding_id) |
| | 32 | VALUES (:date, :start_time, :end_time, :status, :price, :venue_id, :wedding_id) |
| | 33 | RETURNING booking_id; |
| | 34 | }}} |
| | 35 | |
| | 36 | 7. The system confirms booking and displays booked venue details. |