| | 1 | = Use-case 0008 - Book Photographer = |
| | 2 | |
| | 3 | '''Initiating actor:''' Bride / Groom (Wedding owner) |
| | 4 | |
| | 5 | '''Other actors:''' Wedding Organizer (Assistant) |
| | 6 | |
| | 7 | == Description == |
| | 8 | The user reserves a photographer for the wedding day. The booking is recorded with date, time range, status and links the photographer to a wedding. |
| | 9 | |
| | 10 | == Scenario == |
| | 11 | 1. The user opens the "Photographers" section. |
| | 12 | 2. The system lists photographers. |
| | 13 | |
| | 14 | {{{ |
| | 15 | SET search_path TO project; |
| | 16 | |
| | 17 | SELECT photographer_id, name, email, phone_number, price_per_hour |
| | 18 | FROM photographer |
| | 19 | ORDER BY name; |
| | 20 | }}} |
| | 21 | |
| | 22 | 3. The user selects a photographer and clicks "Book". |
| | 23 | 4. The system displays a booking form. |
| | 24 | 5. The user submits booking. |
| | 25 | 6. The system saves the booking in the database. |
| | 26 | |
| | 27 | {{{ |
| | 28 | SET search_path TO project; |
| | 29 | |
| | 30 | INSERT INTO photographer_booking("date", start_time, end_time, status, photographer_id, wedding_id) |
| | 31 | VALUES (:date, :start_time, :end_time, :status, :photographer_id, :wedding_id) |
| | 32 | RETURNING booking_id; |
| | 33 | }}} |
| | 34 | |
| | 35 | 7. The system confirms booking and displays booking details. |