# 🚀 Complete Booking Scenarios Testing Guide
## 📋 Pre-Testing Checklist
Before we start, ensure:
- ✅ Migrations run: `php artisan migrate`
- ✅ Seeders run: `php artisan db:seed`
- ✅ You're logged in to the system
- ✅ You have at least one venue with ID (e.g., venue ID = 7)
---
## 🎯 SCENARIO 1: RENTALS Booking
### Test URL:
```
https://zapazime.bg/web/venue/7?type=rentals
```
OR just:
```
https://zapazime.bg/web/venue/7
```
### What to Test:
**1. Page Load:**
- ✅ Should see "Book Your Rental" header
- ✅ Should see room types section (if available)
- ✅ Should see "Additional Services & Packages" section
- ✅ Should see booking summary on the right
- ✅ Flatpickr date pickers should work
**2. Select Items:**
- ✅ Use quantity steppers (+/-) to add rooms
- ✅ Use quantity steppers to add services
- ✅ Use quantity steppers to add packages
- ✅ Booking summary should update in real-time
- ✅ Dual currency (EUR/BGN) should display
**3. Fill Form:**
- ✅ Select check-in date (Flatpickr calendar)
- ✅ Select check-out date
- ✅ Enter number of guests
- ✅ Add special requests (optional)
**4. Submit:**
- ✅ Click "Proceed to Booking"
- ✅ Should redirect to confirmation page
- ✅ Should see booking number
**5. Verify Database:**
```sql
-- Check booking
SELECT * FROM bookings ORDER BY id DESC LIMIT 1;
-- Check rooms (if selected)
SELECT * FROM booking_room WHERE booking_id = [last_id];
-- Check services (if selected)
SELECT * FROM booking_venue_service WHERE booking_id = [last_id];
-- Check packages (if selected)
SELECT * FROM booking_venue_package WHERE booking_id = [last_id];
```
---
## 🏖️ SCENARIO 2: SPOTS Booking
### Test URL:
```
https://zapazime.bg/web/venue/7?type=spots
```
### What to Test:
**1. Page Load:**
- ✅ Should see "Select Your Spot" header
- ✅ Should see spot grid/layout
- ✅ Should see legend (Available/Occupied/VIP/Selected)
- ✅ Should see spot statistics
- ✅ Flatpickr date pickers should work
**2. Select Spots:**
- ✅ Click check-in date (Flatpickr)
- ✅ Click check-out date
- ✅ Click on green (available) spots
- ✅ Spots should turn blue when selected
- ✅ Hover over spots to see capacity
- ✅ VIP spots should have yellow badge
- ✅ Booking summary should update with spot details
**3. Verify Selection:**
- ✅ Selected spots show in booking summary
- ✅ Total price calculates correctly (price × nights)
- ✅ Total capacity shows correctly
**4. Submit:**
- ✅ Enter number of guests
- ✅ Click "Proceed to Booking"
- ✅ Should redirect to confirmation
**5. Verify Database:**
```sql
-- Check booking
SELECT * FROM bookings ORDER BY id DESC LIMIT 1;
-- Check spots
SELECT
bvs.*,
vs.name as spot_name,
vs.price
FROM booking_venue_spots bvs
JOIN venue_spots vs ON bvs.venue_spot_id = vs.id
WHERE bvs.booking_id = [last_id];
```
---
## 👩⚕️ SCENARIO 3: SERVICES Booking (Dual Flow)
### Test URL:
```
https://zapazime.bg/web/venue/7?type=services
```
### 3A: SERVICE-FIRST Flow 🔵
**1. Page Load:**
- ✅ Should see "Book a Service Appointment" header
- ✅ Should see two tabs: "Choose Service First" (active) and "Choose Provider First"
- ✅ Should see service cards grid
**2. Select Service:**
- ✅ Click on any service card (e.g., "Massage Therapy")
- ✅ Service card should highlight with blue border
- ✅ Should see "Choose Your Provider" section appear
- ✅ Should see ONLY providers who offer that service
**3. Select Provider:**
- ✅ Click on a provider from filtered list
- ✅ Provider card should highlight
- ✅ Should see "Select Date & Time" section appear
- ✅ Should scroll smoothly to time slots
**4. Select Date & Time:**
- ✅ Click appointment date (Flatpickr calendar)
- ✅ Select future date
- ✅ Click on green time slot
- ✅ Time slot should turn blue
**5. Submit:**
- ✅ Enter number of guests
- ✅ Click "Proceed to Booking"
- ✅ Should redirect to confirmation
**6. Verify Hidden Fields:**
Open DevTools → Elements:
- ✅ `selected_service` should have service ID
- ✅ `selected_provider` should have provider ID
- ✅ `selected_time_slot` should have time (e.g., "09:00")
---
### 3B: PROVIDER-FIRST Flow 👤
**1. Switch Tab:**
- ✅ Click "Choose Provider First" tab
- ✅ Tab should become active (blue)
- ✅ Service-first content should hide
- ✅ Provider-first content should show
- ✅ Description changes to "Select a provider..."
**2. Verify Provider Cards:**
- ✅ Should see all providers
- ✅ Each card shows: photo, name, specialization, rating, experience
- ✅ **Services Offered section** shows (first 3 + count)
- ✅ Hourly rate displayed
**3. Select Provider:**
- ✅ Click on any provider
- ✅ Provider card highlights
- ✅ Should see "Choose a Service" section appear
- ✅ Should see ALL services offered by that provider
**4. Select Service:**
- ✅ Click on a service card
- ✅ Service card highlights
- ✅ Should see "Select Date & Time" section appear
**5. Select Date & Time:**
- ✅ Same as Service-First flow
**6. Submit:**
- ✅ Same as Service-First flow
**7. Verify Database:**
```sql
-- Check booking
SELECT * FROM bookings ORDER BY id DESC LIMIT 1;
-- Check appointment
SELECT
ba.*,
vsp.name as provider_name,
vsp.specialization
FROM booking_appointments ba
JOIN venue_service_providers vsp ON ba.venue_service_provider_id = vsp.id
WHERE ba.booking_id = [last_id];
-- Should have:
-- - booking_id
-- - venue_service_provider_id
-- - service_id (NEW - should have value!)
-- - appointment_date
-- - time_slot
-- - price (from service or provider)
-- - status = 'scheduled'
-- - notes with service name
```
---
## ✅ Success Criteria
### All Tests Pass When:
**RENTALS:**
- ✅ Can select rooms, services, packages
- ✅ Booking summary updates correctly
- ✅ Booking creates successfully
- ✅ Database has correct data in all pivot tables
**SPOTS:**
- ✅ Can select multiple spots
- ✅ Spot availability shows correctly
- ✅ Price calculates per night
- ✅ Database has spots in `booking_venue_spots`
**SERVICES (Both Flows):**
- ✅ Service-first: Service → Providers → Time works
- ✅ Provider-first: Provider → Services → Time works
- ✅ Tab switching resets selections
- ✅ Database has appointment with service_id
---
## 🐛 Common Issues & Solutions
**Issue: "Column not found: service_id"**
- Run: `php artisan migrate`
**Issue: No services/providers showing**
- Run: `php artisan db:seed`
**Issue: Flatpickr not working**
- Hard refresh: Ctrl+Shift+R
**Issue: JavaScript errors**
- Check browser console
- Clear cache
---
## 📊 Quick Verification Queries
```sql
-- Latest booking
SELECT * FROM bookings ORDER BY id DESC LIMIT 1;
-- Booking with all relationships
SELECT
b.id,
b.booking_number,
b.booking_type,
b.total_price,
b.status,
v.name as venue_name
FROM bookings b
JOIN venues v ON b.venue_id = v.id
ORDER BY b.id DESC
LIMIT 5;
```
---
## 🎯 Testing Order
1. **Start with SCENARIO 1 (RENTALS)** ← Begin here
2. Then SCENARIO 2 (SPOTS)
3. Finally SCENARIO 3 (SERVICES - both flows)
---
## 📝 Test Results Template
```
# Test Results - [Date]
## SCENARIO 1: RENTALS
- [ ] Page loads correctly
- [ ] Can select rooms
- [ ] Can select services
- [ ] Can select packages
- [ ] Booking summary updates
- [ ] Form submission works
- [ ] Database verification passed
- [ ] Confirmation page shows
## SCENARIO 2: SPOTS
- [ ] Page loads correctly
- [ ] Spot grid displays
- [ ] Can select spots
- [ ] Booking summary updates
- [ ] Form submission works
- [ ] Database verification passed
- [ ] Confirmation page shows
## SCENARIO 3A: SERVICES (Service-First)
- [ ] Page loads correctly
- [ ] Can select service
- [ ] Providers filter correctly
- [ ] Can select provider
- [ ] Can select time slot
- [ ] Form submission works
- [ ] Database verification passed
- [ ] service_id saved correctly
## SCENARIO 3B: SERVICES (Provider-First)
- [ ] Can switch tabs
- [ ] Can select provider
- [ ] Provider's services display
- [ ] Can select service
- [ ] Can select time slot
- [ ] Form submission works
- [ ] Database verification passed
- [ ] service_id saved correctly
## Overall Status
- [ ] All scenarios passed
- [ ] Ready for production
```
---
## 🎉 Success!
When all tests pass, you have:
- ✅ Complete rentals booking system
- ✅ Complete spots booking system
- ✅ Complete services booking system with dual flow
- ✅ All data saving correctly to database
- ✅ Production-ready booking platform!
**Happy Testing!** 🚀