152 lines
4.4 KiB
Plaintext
152 lines
4.4 KiB
Plaintext
========================================
|
|
🚀 MAJOR FEATURE UPDATE - IMPLEMENTATION PLAN
|
|
========================================
|
|
|
|
## FEATURES TO IMPLEMENT:
|
|
|
|
1. ✅ Admin can upload avatars for other users
|
|
2. ✅ Chore assignment type (any_one vs all_assigned)
|
|
3. ✅ Kiosk: Show unallocated chores (expandable)
|
|
4. ✅ Kiosk: Completion confirmation modal (completed/with help/cancel)
|
|
|
|
========================================
|
|
IMPLEMENTATION STEPS:
|
|
========================================
|
|
|
|
## PHASE 1: DATABASE & MODELS
|
|
|
|
### Step 1A: Run Migration
|
|
```
|
|
python backend/migrations/004_add_assignment_type.py
|
|
```
|
|
Adds: chores.assignment_type column
|
|
|
|
### Step 1B: Update Models
|
|
- backend/app/models/chore.py - Add assignment_type field
|
|
- backend/app/schemas/chore.py - Add assignment_type to schemas
|
|
|
|
### Step 1C: Add Admin Avatar Upload Endpoint
|
|
- backend/app/api/v1/uploads.py - Add admin_upload_avatar(user_id, file)
|
|
|
|
========================================
|
|
|
|
## PHASE 2: BACKEND API UPDATES
|
|
|
|
### Step 2A: Chore Assignment Type
|
|
Files to update:
|
|
- ✅ backend/app/models/chore.py
|
|
- ✅ backend/app/schemas/chore.py
|
|
- ✅ backend/app/api/v1/chores.py (create/update endpoints)
|
|
|
|
### Step 2B: Admin Avatar Upload
|
|
Files to update:
|
|
- ✅ backend/app/api/v1/uploads.py
|
|
- POST /api/v1/uploads/users/{user_id}/avatar (admin only)
|
|
- DELETE /api/v1/uploads/users/{user_id}/avatar (admin only)
|
|
|
|
### Step 2C: Public Chores Endpoint Update
|
|
Files to update:
|
|
- ✅ backend/app/api/v1/public.py
|
|
- GET /api/v1/public/chores (add assignment_type to response)
|
|
- POST /api/v1/public/chores/{id}/complete (handle assignment_type logic)
|
|
- POST /api/v1/public/chores/{id}/claim (new - claim unassigned chore)
|
|
|
|
========================================
|
|
|
|
## PHASE 3: FRONTEND UPDATES
|
|
|
|
### Step 3A: Upload Service
|
|
Files to update:
|
|
- ✅ frontend/src/api/uploads.ts
|
|
- Add uploadAvatarForUser(userId, file)
|
|
- Add deleteAvatarForUser(userId)
|
|
|
|
### Step 3B: Avatar Upload Component
|
|
Files to update:
|
|
- ✅ frontend/src/components/AvatarUpload.tsx
|
|
- Add userId prop (optional)
|
|
- Use admin endpoint if userId provided
|
|
|
|
### Step 3C: Settings Page
|
|
Files to update:
|
|
- ✅ frontend/src/pages/Settings.tsx
|
|
- Pass userId to AvatarUpload in admin edit modal
|
|
|
|
### Step 3D: Chore Forms
|
|
Files to update:
|
|
- ✅ frontend/src/components/CreateChoreModal.tsx (add assignment_type select)
|
|
- ✅ frontend/src/components/EditChoreModal.tsx (add assignment_type select)
|
|
- ✅ frontend/src/api/chores.ts (add assignment_type to interface)
|
|
|
|
### Step 3E: Kiosk View - Major Update
|
|
Files to update:
|
|
- ✅ frontend/src/pages/KioskView.tsx
|
|
- Add "Available Chores" expandable section
|
|
- Add CompletionModal component (completed/with help/cancel)
|
|
- Handle claiming unassigned chores
|
|
- Show assignment_type indicators
|
|
|
|
========================================
|
|
|
|
## IMPLEMENTATION ORDER:
|
|
|
|
1. Run migration (004_add_assignment_type.py)
|
|
2. Update backend models/schemas
|
|
3. Update backend API endpoints
|
|
4. Update frontend services/components
|
|
5. Test each feature individually
|
|
6. Test integration
|
|
|
|
========================================
|
|
|
|
## FILES TO CREATE/UPDATE:
|
|
|
|
### Backend (7 files):
|
|
✅ migrations/004_add_assignment_type.py (NEW)
|
|
✅ app/models/chore.py (UPDATE)
|
|
✅ app/schemas/chore.py (UPDATE)
|
|
✅ app/api/v1/chores.py (UPDATE)
|
|
✅ app/api/v1/uploads.py (UPDATE)
|
|
✅ app/api/v1/public.py (UPDATE)
|
|
|
|
### Frontend (8 files):
|
|
✅ api/uploads.ts (UPDATE)
|
|
✅ api/chores.ts (UPDATE)
|
|
✅ components/AvatarUpload.tsx (UPDATE)
|
|
✅ components/CreateChoreModal.tsx (UPDATE)
|
|
✅ components/EditChoreModal.tsx (UPDATE)
|
|
✅ pages/Settings.tsx (UPDATE)
|
|
✅ pages/KioskView.tsx (MAJOR UPDATE)
|
|
|
|
========================================
|
|
|
|
## TESTING CHECKLIST:
|
|
|
|
### Assignment Type:
|
|
- [ ] Create chore with "any_one" - only one person needs to complete
|
|
- [ ] Create chore with "all_assigned" - all must complete
|
|
- [ ] Kiosk shows correct completion state
|
|
|
|
### Admin Avatar Upload:
|
|
- [ ] Admin can upload avatar for other user
|
|
- [ ] Admin can delete avatar for other user
|
|
- [ ] Regular user can't access admin endpoints
|
|
|
|
### Kiosk - Available Chores:
|
|
- [ ] Section expands/collapses
|
|
- [ ] Shows chores not assigned to user
|
|
- [ ] User can claim and complete
|
|
- [ ] Claimed chore moves to "My Chores"
|
|
|
|
### Kiosk - Completion Modal:
|
|
- [ ] "Completed" - marks as done
|
|
- [ ] "Completed with Help" - shows user selector
|
|
- [ ] Selected helpers are recorded
|
|
- [ ] "Cancel" closes modal
|
|
|
|
========================================
|
|
|
|
Ready to implement? Let's go!
|
|
|
|
========================================
|