feat(diagrammes): créer tous les diagrammes d'entités du projet
Création complète de tous les modèles de données : ✅ Déjà existants : - modele-global.md : USERS, CONTENTS, SUBSCRIPTIONS, LISTENING_HISTORY - modele-moderation.md : REPORTS, SANCTIONS, APPEALS, STRIKES, BADGES 🆕 Nouveaux diagrammes : - modele-recommandation.md : USER_INTERESTS, INTEREST_CATEGORIES Jauges 0-100%, évolution temps réel, pas de dégradation temporelle - modele-publicites.md : AD_CAMPAIGNS, AD_METRICS, AD_IMPRESSIONS Ciblage géo/horaire/intérêts, budget prépayé, validation 24-48h - modele-premium.md : PREMIUM_SUBSCRIPTIONS, ACTIVE_STREAMS, OFFLINE_DOWNLOADS Multi-devices (1 stream actif), offline 30j, sans essai gratuit - modele-monetisation.md : CREATOR_MONETIZATION, CREATOR_REVENUES, PAYOUTS KYC obligatoire, revenus pub (3€/1000) + premium (70/30), seuil 50€ - modele-audio-guides.md : AUDIO_GUIDES, GUIDE_SEQUENCES, USER_GUIDE_PROGRESS Multi-séquences GPS, 4 modes (piéton/voiture/vélo/transport), 2-50 séquences - modele-radio-live.md : LIVE_STREAMS, LIVE_RECORDINGS, LIVE_LISTENERS Buffer 15s, max 8h, enregistrement auto, notification abonnés Avantages architecture : ✅ Séparation entités globales (1 source vérité) ✅ Diagrammes focalisés par domaine métier ✅ Maintenance simplifiée (pas de duplication) ✅ Cohérence avec règles métier validées 8 modèles de données complets couvrant 100% du projet MVP.
This commit is contained in:
58
docs/diagrammes/entites/modele-premium.md
Normal file
58
docs/diagrammes/entites/modele-premium.md
Normal file
@@ -0,0 +1,58 @@
|
||||
# Modèle de données - Premium
|
||||
|
||||
📖 Voir [Règles métier - Section 17 : Premium](../../regles-metier/17-premium.md) | [Entités globales](modele-global.md)
|
||||
|
||||
## Diagramme
|
||||
|
||||
```mermaid
|
||||
erDiagram
|
||||
PREMIUM_SUBSCRIPTIONS }o--|| USERS : "abonnement"
|
||||
ACTIVE_STREAMS }o--|| USERS : "stream actif"
|
||||
ACTIVE_STREAMS }o--|| CONTENTS : "écoute"
|
||||
|
||||
OFFLINE_DOWNLOADS }o--|| USERS : "téléchargé par"
|
||||
OFFLINE_DOWNLOADS }o--|| CONTENTS : "contenu"
|
||||
|
||||
PREMIUM_SUBSCRIPTIONS {
|
||||
uuid id PK
|
||||
uuid user_id FK UK
|
||||
string provider
|
||||
string provider_subscription_id
|
||||
string provider_user_id
|
||||
string status
|
||||
string plan
|
||||
timestamp current_period_start
|
||||
timestamp current_period_end
|
||||
timestamp cancelled_at
|
||||
timestamp created_at
|
||||
}
|
||||
|
||||
ACTIVE_STREAMS {
|
||||
uuid id PK
|
||||
uuid user_id FK UK
|
||||
uuid content_id FK
|
||||
string device_id
|
||||
string mode
|
||||
int last_position_seconds
|
||||
timestamp started_at
|
||||
timestamp last_heartbeat
|
||||
}
|
||||
|
||||
OFFLINE_DOWNLOADS {
|
||||
uuid id PK
|
||||
uuid user_id FK
|
||||
uuid content_id FK
|
||||
string quality
|
||||
int file_size_bytes
|
||||
timestamp downloaded_at
|
||||
timestamp expires_at
|
||||
}
|
||||
```
|
||||
|
||||
## Légende
|
||||
|
||||
**Entités Premium** :
|
||||
|
||||
- **PREMIUM_SUBSCRIPTIONS** : Abonnements Premium - Provider : `mangopay` (web 4.99€), `apple` (IAP 5.99€), `google` (Play 5.99€) - Status : `active`, `cancelled`, `expired`, `past_due` - Plan : `monthly` (4.99€), `yearly` (49.99€ = 2 mois offerts) - Pas d'essai gratuit - Vérification temps réel via Redis cache (TTL 1h) + webhooks providers
|
||||
- **ACTIVE_STREAMS** : Streams actifs multi-devices - Limite 1 stream actif par compte (dernier device prioritaire KISS) - Mode : `online`, `offline` (si offline + WiFi/4G) - Heartbeat 30s, TTL Redis 5 min - Détection simultanée : WebSocket close device précédent - Exception : offline mode avion (pas de détection possible)
|
||||
- **OFFLINE_DOWNLOADS** : Téléchargements offline - Quality : `low` (24 kbps), `standard` (48 kbps), `high` (64 kbps Premium only) - Limite gratuit : 50 contenus max, Premium : illimité (espace disque) - Validité 30j, renouvellement auto si WiFi - Suppression auto après expiration
|
||||
Reference in New Issue
Block a user