diff --git a/README.md b/README.md index 50a0950..2eea417 100644 --- a/README.md +++ b/README.md @@ -237,6 +237,8 @@ The `local-dev-2.sh` script automatically seeds: * Admin user (`admin@example.com` / `password`) * Regular user (`user@example.com` / `password`) * 8 services: + * 6 standard (no patch test) + * 2 with patch test requirement (24h) - Gel Polish Full Set, Luxury Gel Manicure * 6 standard (no patch test) * 2 with patch test requirement (48h) - Gel Polish Full Set, Luxury Gel Manicure @@ -287,7 +289,8 @@ docker compose exec backend sh | User Referrals | ✅ | ❌ | `user_referrals` table, backend logic exists | | Token Refresh | ✅ | ✅ | POST /api/refresh-token, auto-refresh in auth store | | Portfolio System | ✅ | ✅ | S3/R2 storage abstraction, tag-based filtering, category filters, admin upload, ?img= featured image param | -| Service Eligibility | ✅ | ✅ | Age + patch test filtering; `/api/services/eligible-for/{user_id}` for admin booking flows | +| Service Eligibility | ✅ | ✅ | Age + patch test filtering (dedicated `patch_tests` table); `/api/services/eligible-for/{user_id}` for admin booking flows | +| Patch Test System | ✅ | ✅ | Dedicated `patch_tests` table, notice periods (24h), expiry (6 months), admin can record in UserModal | | Image Metadata Stripping | ✅ | ❌ | EXIF/GPS stripped on upload via `imaging` library | | Profile Pictures | ✅ | ✅ | Upload to separate bucket, cropper, circular display, CalDAV sync | | Auto-Booking Status | ✅ | ✅ | Auto-transition: confirmed → in_progress → completed based on time | @@ -480,7 +483,14 @@ grep -rn "console\.log" frontend/src/ --include="*.svelte" --include="*.ts" | Table | Purpose | |-------|--------| -| `users` | Customer and admin accounts | +KR|| `users` | Customer and admin accounts | +WW|| `verification_codes` | Email verification and password reset codes | +TW|| `services` | Salon service catalog | +QB|| `patch_tests` | Patch test definitions with notice periods and expiry | +SP|| `user_patch_tests` | User patch test completion records | +SP|| `bookings` | Appointment records | +SP|| `booking_services` | Services per booking (many-to-many) | +SP|| `booking_edit_requests` | Pending customer edit requests | | `verification_codes` | Email verification and password reset codes | | `services` | Salon service catalog | | `bookings` | Appointment records | diff --git a/obsidian/Crussell/Crussell Nails.md b/obsidian/Crussell/Crussell Nails.md index 603cec0..1156e5b 100644 --- a/obsidian/Crussell/Crussell Nails.md +++ b/obsidian/Crussell/Crussell Nails.md @@ -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,