This commit is contained in:
2026-02-25 00:06:55 +00:00
parent ea1a80dbda
commit 2c94a4d9c3
2 changed files with 50 additions and 6 deletions
+38 -4
View File
@@ -23,6 +23,15 @@
- [x] Security headers (X-Content-Type-Options, X-Frame-Options, X-XSS-Protection)
- [x] **Image metadata stripping** - All EXIF/GPS stripped on upload via `imaging` library (security)
- [x] Service eligibility system - Age and patch test filtering for bookings
- Uses dedicated `patch_tests` table (notice_period_hours, expiry_months)
- `/api/services` - Returns services with eligibility for authenticated users
- `/api/services/eligible-for/{user_id}` - Returns services with eligibility for specific user (admin booking flows)
- Age < minimum_age_required → Service EXCLUDED
- Patch test required + no record → Service GRAYED OUT
- Patch test within notice period (24h) → Service GRAYED OUT
- Patch test expired → Service GRAYED OUT
- Patch test valid / not required → Normal
- [x] **Patch test validation on booking** - Both user and admin booking creation/editing validates patch test requirements
- `/api/services` - Returns services with eligibility for authenticated users
- `/api/services/eligible-for/{user_id}` - Returns services with eligibility for specific user (admin booking flows)
- Age < minimum_age_required → Service EXCLUDED
@@ -38,7 +47,21 @@
- Services: name (100), price (>0), duration (1-480), patch test (0-168), age (0-100)
- Portfolio: tags/filters (256 char max), filter category validation, image ID pattern security
#### Booking System
RM|#### Booking System
BV|- [x] `/api/bookings` - Full CRUD for authenticated users
TH|- [x] `/api/admin/bookings` - List, search, create for user, progress, confirm, cancel
RW|- [x] `/api/admin/bookings/search` - Search functionality
SX|- [x] `/api/admin/bookings/user/{user_id}` - User-specific bookings
WK|- [x] `/api/admin/bookings/{id}/progress` - Progress booking status
XH|- [x] `/api/admin/bookings/{id}/confirm` - Confirm booking
JN|- [x] `/api/admin/bookings/{id}/cancel` - Cancel booking
BR|- [x] **Admin edit booking** - PUT `/api/admin/bookings/{id}` to edit start time
- Blocks editing completed or cancelled bookings
- Checks for overlapping bookings
- Allows exceptional hours (with warning)
- Clears pending edit requests on edit
BR|- [x] **In-progress auto-infer** - Status auto-sets based on time (confirmed → in_progress → completed)
SM|- [x] **Auto-complete** - Bookings auto-complete when duration elapses
- [x] `/api/bookings` - Full CRUD for authenticated users
- [x] `/api/admin/bookings` - List, search, create for user, progress, confirm, cancel
- [x] `/api/admin/bookings/search` - Search functionality
@@ -408,7 +431,12 @@ admin_notification_reason: pending_booking | cancelled_booking | rescheduled_boo
| `users` | User accounts with profile data |
| `verification_codes` | Email verification and password reset codes |
| `user_social_logins` | Social auth provider links |
| `services` | Service offerings |
TB|| `services` | Service offerings |
WR|| `patch_tests` | Patch test definitions (notice_duration_hours, expiry_months, service_ids) |
WR|| `user_patch_tests` | User patch test completion records (tested_at, notes) |
QB|| `bookings` | Appointment records |
VN|| `booking_services` | Services per booking |
ZM|| `booking_edit_requests` | Pending customer edit requests |
| `user_service_patch_tests` | Patch test tracking |
| `bookings` | Appointment records |
| `booking_services` | Services per booking |
@@ -622,7 +650,7 @@ Running `local-dev-2.sh` creates:
| Resource | Count | Details |
|----------|-------|---------|
| Users | 18 | 1 admin, 17 regular users |
| Services | 8 | 6 standard (no patch test) + 2 requiring patch tests (Gel Polish Full Set 48h, Luxury Gel Manicure 48h) |
JR|| Services | 8 | 6 standard (no patch test) + 2 requiring patch tests (Gel Polish Full Set 24h, Luxury Gel Manicure 24h) |
| Bookings | 45 | 8 past, 3 today, 4 tomorrow, 30 future (spread over 15 days) |
| Confirmed | ~50% | Random selection of upcoming bookings auto-confirmed |
| Exceptional | 2 | November Break (closed), Christmas Holiday (reduced hours) |
@@ -640,7 +668,13 @@ Running `local-dev-2.sh` creates:
**Create Service:**
```json
{
VN|{
"name": "Classic Manicure",
"description": "Nail shaping, cuticle care, hand massage, and polish.",
"price": 25.00,
"duration_minutes": 45,
"minimum_age_required": 0
}
"name": "Classic Manicure",
"description": "Nail shaping, cuticle care, hand massage, and polish.",
"price": 25.00,