diff --git a/CLAUDE.md b/CLAUDE.md index db7f837..3360784 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -97,20 +97,31 @@ mitai-jinkendo/ - ✅ **Modulare Backend-Architektur**: 14 Router-Module, main.py von 1878→75 Zeilen (-96%) ### Was in v9c kommt: Subscription & Coupon Management System -**Core Features:** +**Phase 1 (DB-Schema): ✅ DONE** +**Phase 2 (Backend API): ✅ DONE** +**Phase 3 (Frontend UI): 🔲 TODO** + +**Core Features (Backend):** +- ✅ DB-Schema (11 neue Tabellen, Feature-Registry Pattern) +- ✅ Feature-Access Middleware (check_feature_access, increment_feature_usage) +- ✅ Flexibles Tier-System (free/basic/premium/selfhosted) - Admin-editierbar via API +- ✅ **Coupon-System** (3 Typen: single_use, period, wellpass) +- ✅ Coupon-Stacking-Logik (Pause + Resume bei Wellpass-Override) +- ✅ Access-Grant-System (zeitlich begrenzte Zugriffe mit Quelle-Tracking) +- ✅ User-Activity-Log (JSONB details) +- ✅ User-Stats (Aggregierte Statistiken) +- ✅ Individuelle User-Restrictions (Admin kann Limits pro User setzen) +- ✅ 7 neue Router, 30+ neue Endpoints (subscription, coupons, features, tiers, tier-limits, user-restrictions, access-grants) + +**Frontend TODO (Phase 3):** - 🔲 Selbst-Registrierung mit E-Mail-Verifizierung (Pflicht) -- 🔲 Flexibles Tier-System (free/basic/premium/selfhosted) - Admin-editierbar -- 🔲 Trial-System (Dauer konfigurierbar, auto-start nach E-Mail-Verifikation) -- 🔲 **Coupon-System** (2 Typen): - - Single-Use Coupons (Geschenke, zeitlich begrenzt) - - Multi-Use Period Coupons (z.B. Wellpass, monatlich erneuerbar) -- 🔲 Coupon-Stacking-Logik (Pause + Resume bei Wellpass-Override) -- 🔲 Access-Grant-System (zeitlich begrenzte Zugriffe mit Quelle-Tracking) -- 🔲 User-Activity-Log (Login, Password-Änderungen, Coupon-Einlösungen, etc.) -- 🔲 User-Stats (Login-Streaks, Nutzungsstatistiken) -- 🔲 Individuelle User-Restrictions (Admin kann Limits pro User setzen) -- 🔲 App-Settings (globale Konfiguration durch Admin) -- 🔲 Erweiterte Admin-User-Verwaltung (Activity-Log, Stats, Access-Historie) +- 🔲 Trial-System UI (Dauer konfigurierbar, auto-start nach E-Mail-Verifikation) +- 🔲 Admin Matrix-Editor (Tier x Feature Limits) +- 🔲 Admin Coupon-Manager (CRUD, Redemption-Historie) +- 🔲 Admin User-Restrictions UI +- 🔲 User Subscription-Info Page +- 🔲 User Coupon-Einlösung UI +- 🔲 App-Settings Admin-Panel (globale Konfiguration) **E-Mail Templates (v9c):** - 🔲 Registrierung + E-Mail-Verifizierung @@ -892,6 +903,12 @@ Dev: dev-mitai-api, dev-mitai-ui ## Bekannte Probleme & Lösungen +### Admin User-Erstellung – Email fehlt (v9c TODO) +**Problem:** Bei Admin-CRUD `/api/profiles` (POST) wird keine Email-Adresse abgefragt. +**Impact:** Neue User können sich nicht einloggen (Login erfordert Email). +**Workaround:** Email manuell via `/api/admin/profiles/{pid}/email` setzen. +**Fix-TODO:** POST `/api/profiles` sollte Email als optionales Feld akzeptieren. + ### dayjs.week() – NIEMALS verwenden ```javascript // ❌ Falsch: