Problème : USERS et CONTENTS dupliqués dans chaque diagramme = maintenance cauchemardesque lors d'évolutions Solution : Extraction des entités communes - modele-global.md : USERS, CONTENTS, SUBSCRIPTIONS, LISTENING_HISTORY - modele-moderation.md : Uniquement entités spécifiques modération (REPORTS, SANCTIONS, APPEALS, STRIKES, MODERATORS, BADGES) Avantages : - Une seule source de vérité pour entités communes - Diagrammes de domaine focalisés sur leur périmètre - Maintenance simplifiée (1 fichier à modifier vs N) - Lien entre diagrammes pour navigation Les futurs diagrammes de domaine (recommandation, monétisation, etc.) référenceront modele-global.md et définiront uniquement leurs entités spécifiques.
69 lines
1.9 KiB
Markdown
69 lines
1.9 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
|
|
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
|