docs: CRITICAL - document missing feature enforcement
All checks were successful
Deploy Development / deploy (push) Successful in 52s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 12s

⚠️ MAJOR GAP IDENTIFIED: Feature limits don't work!
- Admin UI exists to configure limits
- But actual enforcement (check_feature_access) is NOT called in endpoints
- Users can exceed limits, use disabled features

Backend TODO (CRITICAL):
- Add feature checks to insights.py (AI analysis)
- Add feature checks to exportdata.py, importdata.py
- Add feature checks to nutrition.py, activity.py (imports)
- Add feature checks to photos.py, data entry endpoints

Frontend TODO (UX):
- Implement useFeatureAccess() hook
- Create <FeatureGate> component
- Hide disabled features
- Show limit counters & upgrade prompts

Estimated work: 2-3 hours

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Lars 2026-03-20 12:25:31 +01:00
parent 5da18de708
commit 0210844522

View File

@ -103,7 +103,7 @@ mitai-jinkendo/
**Core Features (Backend):** **Core Features (Backend):**
- ✅ DB-Schema (11 neue Tabellen, Feature-Registry Pattern) - ✅ DB-Schema (11 neue Tabellen, Feature-Registry Pattern)
- ✅ Feature-Access Middleware (check_feature_access, increment_feature_usage) - ⚠️ Feature-Access Middleware (existiert, aber wird NICHT in Endpoints aufgerufen - siehe KRITISCH unten!)
- ✅ Flexibles Tier-System (free/basic/premium/selfhosted) - Admin-editierbar via API - ✅ Flexibles Tier-System (free/basic/premium/selfhosted) - Admin-editierbar via API
- ✅ **Coupon-System** (3 Typen: single_use, period, wellpass) - ✅ **Coupon-System** (3 Typen: single_use, period, wellpass)
- ✅ Coupon-Stacking-Logik (Pause + Resume bei Wellpass-Override) - ✅ Coupon-Stacking-Logik (Pause + Resume bei Wellpass-Override)
@ -125,6 +125,43 @@ mitai-jinkendo/
- 🔲 Trial-System UI (Countdown-Banner, auto-start nach E-Mail-Verifikation) - 🔲 Trial-System UI (Countdown-Banner, auto-start nach E-Mail-Verifikation)
- 🔲 App-Settings Admin-Panel (globale Konfiguration: trial_days, allow_registration, etc.) - 🔲 App-Settings Admin-Panel (globale Konfiguration: trial_days, allow_registration, etc.)
**⚠️ KRITISCH: Feature-Enforcement fehlt noch! (März 2026)**
**Problem:** Admin-UI zum Konfigurieren existiert, aber die eigentliche Prüfung/Durchsetzung fehlt!
- User kann Limits überschreiten (KI-Analysen, Export, etc.)
- Deaktivierte Features sind trotzdem nutzbar
- Feature-Middleware existiert aber wird NICHT aufgerufen
**Backend TODO (KRITISCH):**
- 🔲 **insights.py** - Feature-Checks für KI-Analysen einbauen
```python
@router.post('/run/{slug}')
def run_analysis(slug: str, session = Depends(require_auth)):
profile_id = session['profile_id']
# TODO: check_feature_access(profile_id, 'ai_calls', action='use')
# TODO: increment_feature_usage(profile_id, 'ai_calls')
```
- 🔲 **exportdata.py** - Feature-Check für Export (CSV/JSON/ZIP)
- 🔲 **importdata.py** - Feature-Check für Import
- 🔲 **nutrition.py** - Feature-Check für FDDB-Import
- 🔲 **activity.py** - Feature-Check für Apple Health Import
- 🔲 **photos.py** - Feature-Check für Progress-Fotos
- 🔲 **weight.py, circumference.py, caliper.py** - Entry-Limits prüfen
**Frontend TODO (wichtig für UX):**
- 🔲 `useFeatureAccess()` Hook implementieren
```javascript
const { canUse, remaining, limit } = useFeatureAccess('ai_calls')
```
- 🔲 `<FeatureGate feature="...">` Komponente erstellen
- 🔲 Feature-Gates in Analysis-Seite (KI-Button ausblenden wenn limit=0)
- 🔲 Feature-Gates in Settings (Export-Buttons)
- 🔲 Feature-Gates in Import-Funktionen
- 🔲 Limit-Anzeige ("3/10 KI-Analysen verbleibend")
- 🔲 Upgrade-Prompt bei Limit erreicht
**Geschätzte Arbeit:** 2-3 Stunden (Backend 60%, Frontend 40%)
**E-Mail Templates (v9c):** **E-Mail Templates (v9c):**
- 🔲 Registrierung + E-Mail-Verifizierung - 🔲 Registrierung + E-Mail-Verifizierung
- 🔲 Einladungslink - 🔲 Einladungslink