Add database seeder with sample data and test guide
This commit is contained in:
+197
@@ -0,0 +1,197 @@
|
||||
# Test Guide - Digital Access and Serving System
|
||||
|
||||
## Quick Start
|
||||
|
||||
1. **Start the system** (if not already running):
|
||||
```bash
|
||||
# Terminal 1: Database
|
||||
docker-compose up -d
|
||||
|
||||
# Terminal 2: Backend (will auto-seed database)
|
||||
dotnet run --project src/Hospitality.Backend
|
||||
|
||||
# Terminal 3: Frontend
|
||||
cd src/hospitality-web
|
||||
npm run dev
|
||||
```
|
||||
|
||||
2. **Access the application**: http://localhost:5173
|
||||
|
||||
## Sample Data Overview
|
||||
|
||||
The database is pre-loaded with:
|
||||
|
||||
### Events
|
||||
1. **Summer Festival 2025** (July 1-3, Oslo)
|
||||
2. **Winter Gala 2025** (December 15, Bergen)
|
||||
|
||||
### Groups (Summer Festival)
|
||||
1. **VIP Sponsors** - 3 people
|
||||
2. **Event Staff** - 2 people
|
||||
3. **General Admission** - 2 people
|
||||
|
||||
### Products (Summer Festival)
|
||||
- Beer (Drink)
|
||||
- Wine (Drink)
|
||||
- Lunch (Meal)
|
||||
- Dinner (Meal)
|
||||
- VIP Lounge Access (Access)
|
||||
|
||||
### Test Guests with QR Codes
|
||||
|
||||
**Note**: QR codes are GUIDs that change each time you seed. To get the actual QR codes:
|
||||
1. Go to Admin → Summer Festival 2025 → VIP Sponsors
|
||||
2. Click on a person to see their QR code
|
||||
|
||||
## Test Scenarios
|
||||
|
||||
### Scenario 1: Admin - View Existing Data
|
||||
|
||||
1. Go to http://localhost:5173
|
||||
2. You should see 2 events: "Summer Festival 2025" and "Winter Gala 2025"
|
||||
3. Click on "Summer Festival 2025"
|
||||
4. You should see:
|
||||
- 3 groups (VIP Sponsors, Event Staff, General Admission)
|
||||
- 5 products (Beer, Wine, Lunch, Dinner, VIP Lounge Access)
|
||||
|
||||
### Scenario 2: Admin - View Group Details
|
||||
|
||||
1. From Event Detail page, click on "VIP Sponsors"
|
||||
2. You should see 3 people:
|
||||
- **John Doe** (john.doe@example.com)
|
||||
- Beer: 8/10 remaining
|
||||
- Wine: 4/5 remaining
|
||||
- Lunch: 2/3 remaining
|
||||
- Dinner: 3/3 remaining
|
||||
- VIP Access: 1/1 remaining
|
||||
|
||||
- **Jane Smith** (jane.smith@example.com)
|
||||
- All quotas unused (full amounts)
|
||||
|
||||
- **Bob Wilson** (bob.wilson@example.com)
|
||||
- Beer: 9/12 remaining
|
||||
- Wine: 2/4 remaining
|
||||
- Lunch: 1/3 remaining
|
||||
- Dinner: 2/3 remaining
|
||||
- VIP Access: 0/1 (used)
|
||||
|
||||
### Scenario 3: Staff Scanner - Lookup Guest
|
||||
|
||||
1. Go to http://localhost:5173/staff
|
||||
2. From Admin, get John Doe's QR code:
|
||||
- Go to Summer Festival → VIP Sponsors → John Doe
|
||||
- Copy the QR code (GUID under "QR: ...")
|
||||
3. Paste the QR code in Staff Scanner
|
||||
4. Click "Lookup Person"
|
||||
5. You should see:
|
||||
- Name: John Doe
|
||||
- Email: john.doe@example.com
|
||||
- All quotas with remaining amounts
|
||||
6. Click "Use 1" on Beer
|
||||
7. Verify quota decreases from 8 to 7
|
||||
|
||||
### Scenario 4: Guest View - Check Quotas
|
||||
|
||||
1. Go to http://localhost:5173/guest
|
||||
2. Enter John Doe's QR code (same as above)
|
||||
3. Click "Show My QR Code"
|
||||
4. You should see:
|
||||
- Large QR code for scanning
|
||||
- All quotas with progress bars
|
||||
- Updated Beer quota (7/10 if you used 1 in Scenario 3)
|
||||
|
||||
### Scenario 5: Admin - Add New Person
|
||||
|
||||
1. Go to Summer Festival → VIP Sponsors
|
||||
2. Click "Add Person"
|
||||
3. Fill in:
|
||||
- Name: "Test User"
|
||||
- Email: "test@example.com"
|
||||
- Phone: "+47 999 88 777"
|
||||
4. Click "Add Person"
|
||||
5. Person appears in the list with a new QR code
|
||||
6. Click "Assign Quota" on the new person
|
||||
7. Select "Beer" and amount "5"
|
||||
8. Click "Assign Quota"
|
||||
9. Verify quota appears under the person
|
||||
|
||||
### Scenario 6: Test Different User Types
|
||||
|
||||
**VIP Sponsor (High Quotas)**
|
||||
- Use Jane Smith's QR code
|
||||
- Has full quotas: Beer (8), Wine (6), Lunch (3), Dinner (3), VIP Access (1)
|
||||
|
||||
**Staff Member (Limited Quotas)**
|
||||
- Use Alice Staff's QR code
|
||||
- Has: Beer (3/4), Lunch (1/2)
|
||||
|
||||
**General Guest (Basic Quotas)**
|
||||
- Use Emily Guest's QR code
|
||||
- Has: Beer (2/3), Lunch (1/1)
|
||||
|
||||
**Heavy User (Mostly Used)**
|
||||
- Use Bob Wilson's QR code
|
||||
- Has used most quotas, VIP Access is depleted
|
||||
|
||||
## Testing Checklist
|
||||
|
||||
- [ ] View events list
|
||||
- [ ] View event details with groups and products
|
||||
- [ ] View group details with people
|
||||
- [ ] View person's QR code and quotas
|
||||
- [ ] Add new person to group
|
||||
- [ ] Assign quota to person
|
||||
- [ ] Use Staff Scanner to lookup person
|
||||
- [ ] Record transaction (Use 1 or Use 2)
|
||||
- [ ] Verify quota decreases after transaction
|
||||
- [ ] Use Guest View to see QR code
|
||||
- [ ] Verify progress bars show correct status
|
||||
- [ ] Test with different user types (VIP, Staff, Guest)
|
||||
- [ ] Try to use more than remaining quota (should fail)
|
||||
|
||||
## Expected Behaviors
|
||||
|
||||
### Success Cases
|
||||
- ✅ Quotas display correctly with remaining amounts
|
||||
- ✅ Transactions record successfully when quota available
|
||||
- ✅ Quota decrements after transaction
|
||||
- ✅ Progress bars update in real-time
|
||||
- ✅ QR codes are unique per person
|
||||
|
||||
### Error Cases
|
||||
- ❌ Cannot use more than remaining quota
|
||||
- ❌ Invalid QR code shows "Not Found"
|
||||
- ❌ Empty fields in forms show validation errors
|
||||
|
||||
## Quick Reference - Sample QR Codes
|
||||
|
||||
**To get actual QR codes:**
|
||||
1. Go to Admin → Summer Festival 2025
|
||||
2. Click on a group (e.g., VIP Sponsors)
|
||||
3. Each person's card shows their QR code (starts with "QR: ...")
|
||||
4. Copy the full GUID for testing
|
||||
|
||||
**Sample People:**
|
||||
- John Doe - Has some usage, good for testing transactions
|
||||
- Jane Smith - Fresh quotas, good for first-time testing
|
||||
- Bob Wilson - Heavy usage, good for testing limits
|
||||
- Alice Staff - Staff member with limited quotas
|
||||
- Emily Guest - Basic guest with minimal quotas
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
**No data showing?**
|
||||
- Restart backend: `dotnet run --project src/Hospitality.Backend`
|
||||
- Database will auto-seed on startup
|
||||
|
||||
**QR code not working?**
|
||||
- Make sure you copied the full GUID
|
||||
- QR codes are case-sensitive
|
||||
- Get fresh QR code from Admin interface
|
||||
|
||||
**Transaction fails?**
|
||||
- Check remaining quota is > 0
|
||||
- Verify you're using correct QR code
|
||||
- Check browser console for errors
|
||||
|
||||
Enjoy testing! 🎉
|
||||
Reference in New Issue
Block a user