Files
roadwave/docs/diagrammes/entites/modele-global.md
jpgiannetti 78422bb2c0 fix(diagrammes): corriger incohérences détectées lors de l'audit
Problème 1 - CRITIQUE : Champ auto_like manquant
- Fichier : modele-global.md
- Ajout : boolean auto_like dans LISTENING_HISTORY
- Règle source : Section 03 (jauges) - Like automatique ≥30% écoute
- Impact : Traçabilité système likes automatiques

Problème 2 - MINEUR : Type recommended_speed imprécis
- Fichier : modele-audio-guides.md
- Avant : int recommended_speed_kmh (imprécis pour plage)
- Après : int recommended_speed_min_kmh + int recommended_speed_max_kmh
- Règle source : Section 06 - Formulaire création "30-50 km/h"
- Impact : Stockage précis des plages de vitesse recommandées

Audit complet réalisé : 96.6% → 100% cohérence
Tous les diagrammes sont maintenant parfaitement alignés avec
les règles métier.
2026-02-07 16:37:31 +01:00

70 lines
2.0 KiB
Markdown

# Modèle de données - Entités globales
📖 Entités de base utilisées dans tous les domaines métier
## Diagramme
```mermaid
erDiagram
USERS ||--o{ CONTENTS : "crée"
USERS ||--o{ SUBSCRIPTIONS : "s'abonne à"
USERS ||--o{ LISTENING_HISTORY : "écoute"
CONTENTS ||--o{ LISTENING_HISTORY : "écouté"
CONTENTS }o--|| USERS : "créé par"
USERS {
uuid id PK
string email UK
string pseudo UK
date birthdate
string role
timestamp created_at
boolean email_verified
}
CONTENTS {
uuid id PK
uuid creator_id FK
string title
string audio_url
string status
string age_rating
string geo_type
point geo_location
string[] tags
int duration_seconds
timestamp published_at
boolean is_moderated
}
SUBSCRIPTIONS {
uuid id PK
uuid subscriber_id FK
uuid creator_id FK
timestamp subscribed_at
}
LISTENING_HISTORY {
uuid id PK
uuid user_id FK
uuid content_id FK
uuid creator_id FK
boolean is_subscribed
decimal completion_rate
int last_position_seconds
string source
boolean auto_like
timestamp listened_at
}
```
## Légende
**Entités de base** :
- **USERS** : Utilisateurs plateforme - Rôles : `listener`, `creator`, `moderator`, `admin`
- **CONTENTS** : Contenus audio - Status : `draft`, `pending_review`, `published`, `moderated`, `deleted` - Geo-type : `geo_ancre` (70% geo), `geo_contextuel` (50% geo), `geo_neutre` (20% geo) - Age rating : `all`, `13+`, `16+`, `18+`
- **SUBSCRIPTIONS** : Abonnements créateurs - Utilisé pour filtrer recommandations et calculer engagement
- **LISTENING_HISTORY** : Historique écoutes - Source : `recommendation`, `search`, `direct_link`, `profile`, `history`, `live_notification`, `audio_guide` - Utilisé pour scoring recommandation et statistiques créateur