Files
roadwave/docs/domains/_shared/entities/entities-overview.md
jpgiannetti b52ffb8db9 feat(rgpd): compléter documentation RGPD avec 12 nouvelles sections
Règles RGPD (docs/domains/_shared/rules/rgpd.md):
- Ajouter sections 13.11-13.22 (droits utilisateurs, mineurs, sécurité)
- Droit de rectification, opposition, limitation du traitement
- Gestion des mineurs: 13 ans minimum + consentement parental 13-15 ans
- Protection renforcée: RoadWave Kids pour < 13 ans
- Sécurité: chiffrement multi-niveaux, procédure breach 72h CNIL
- Politique de confidentialité avec versioning
- Sous-traitants, DPIA, délais de réponse

Entités (6 nouvelles):
- PARENTAL_CONSENTS + PARENTAL_CONTROLS (workflow 13-15 ans)
- PRIVACY_POLICY_VERSIONS + USER_POLICY_ACCEPTANCES
- ACCOUNT_DELETIONS (grace period 30j)
- BREACH_INCIDENTS + BREACH_AFFECTED_USERS
- USER_PROFILE_HISTORY (audit trail rectification)
- DATA_RETENTION_LOGS (purge 5 ans)

Diagrammes séquences (5 nouveaux):
- Consentement parental avec validation email
- Anonymisation GPS automatique après 24h
- Notification breach CNIL (procédure 72h)
- Export données asynchrone
- Suppression compte avec grace period

Cycles de vie (3 nouveaux + 1 enrichi):
- parental-consent-lifecycle.md
- breach-incident-lifecycle.md
- account-deletion-lifecycle.md
- user-account-lifecycle.md (ajout états mineurs, frozen)

Features BDD (4 nouvelles, 195 scénarios RGPD):
- minors-protection.feature (9 scénarios)
- data-security.feature (12 scénarios)
- privacy-policy.feature (8 scénarios)
- user-rights.feature (8 scénarios)

Infrastructure:
- Réorganiser docs générées: docs/bdd + output → generated/bdd + generated/pdf
- Mettre à jour mkdocs.yml, Makefile, scripts Python
- Ajouter /generated/ au .gitignore
2026-02-08 17:54:46 +01:00

8.9 KiB

Modèle de données - Entités globales

📖 Entités de base utilisées dans tous les domaines métier

Diagramme

erDiagram
    USERS ||--o{ CONTENTS : "crée"
    USERS ||--o{ SUBSCRIPTIONS : "s'abonne à"
    USERS ||--o{ LISTENING_HISTORY : "écoute"
    USERS ||--o{ SESSIONS : "possède"
    USERS ||--o{ DEVICES : "possède"
    USERS ||--o{ USER_CONSENTS : "donne"
    USERS ||--o{ LOCATION_HISTORY : "génère"
    USERS ||--o{ INTEREST_GAUGES : "possède"
    USERS ||--o{ REPORTS : "signale"
    USERS ||--o{ DATA_EXPORTS : "demande"
    USERS ||--o{ PARENTAL_CONSENTS : "a"
    USERS ||--o{ ACCOUNT_DELETIONS : "demande"
    USERS ||--o{ USER_PROFILE_HISTORY : "modifie"

    PARENTAL_CONSENTS ||--|| PARENTAL_CONTROLS : "configure"
    PRIVACY_POLICY_VERSIONS ||--o{ USER_POLICY_ACCEPTANCES : "acceptée par"
    USERS ||--o{ USER_POLICY_ACCEPTANCES : "accepte"
    BREACH_INCIDENTS ||--o{ BREACH_AFFECTED_USERS : "impacte"
    USERS ||--o{ BREACH_AFFECTED_USERS : "est impacté"

    CONTENTS ||--o{ LISTENING_HISTORY : "écouté"
    CONTENTS }o--|| USERS : "créé par"
    CONTENTS ||--o{ REPORTS : "reçoit"

    DEVICES ||--o{ SESSIONS : "a"

    USERS {
        uuid id PK
        string email UK
        string pseudo UK
        date birthdate
        string role
        string account_status
        timestamp created_at
        timestamp last_login_at
        boolean email_verified
        boolean kyc_verified
        string phone_number
        int trust_score
        timestamp deletion_requested_at
        timestamp inactivity_notified_at
    }

    CONTENTS {
        uuid id PK
        uuid creator_id FK
        string title
        string audio_url
        string status
        string moderation_status
        string age_rating
        string geo_type
        point geo_location
        string[] tags
        int duration_seconds
        timestamp published_at
        int reports_count
        text moderation_notes
    }

    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
    }

    SESSIONS {
        uuid id PK
        uuid user_id FK
        uuid device_id FK
        string access_token_hash
        string refresh_token_hash
        timestamp access_token_expires_at
        timestamp refresh_token_expires_at
        inet ip_address
        string user_agent
        string city
        string country_code
        timestamp created_at
        timestamp last_activity_at
        timestamp revoked_at
    }

    DEVICES {
        uuid id PK
        uuid user_id FK
        string device_name
        string os
        string browser
        string device_type
        boolean is_trusted
        timestamp trusted_until
        timestamp first_seen_at
        timestamp last_seen_at
    }

    USER_CONSENTS {
        uuid id PK
        uuid user_id FK
        string consent_type
        string consent_version
        boolean accepted
        timestamp given_at
    }

    LOCATION_HISTORY {
        uuid id PK
        uuid user_id FK
        geography location
        string geohash
        boolean anonymized
        string context
        timestamp created_at
        timestamp anonymized_at
    }

    INTEREST_GAUGES {
        uuid id PK
        uuid user_id FK
        string category
        decimal score
        timestamp last_updated
        int interactions_count
    }

    REPORTS {
        uuid id PK
        uuid content_id FK
        uuid reporter_id FK
        uuid moderator_id FK
        string category
        string status
        text comment
        timestamp reported_at
        timestamp reviewed_at
        text moderator_notes
        string action_taken
    }

    DATA_EXPORTS {
        uuid id PK
        uuid user_id FK
        string status
        string export_url
        bigint size_bytes
        string format
        timestamp requested_at
        timestamp generated_at
        timestamp expires_at
    }

    PARENTAL_CONSENTS {
        uuid id PK
        uuid user_id FK
        string parent_email
        boolean validated
        timestamp validated_at
        timestamp revoked_at
    }

    PARENTAL_CONTROLS {
        uuid id PK
        uuid parental_consent_id FK
        boolean gps_enabled
        boolean messaging_enabled
        boolean content_16plus_enabled
    }

    PRIVACY_POLICY_VERSIONS {
        uuid id PK
        string version
        boolean major_change
        timestamp effective_date
    }

    USER_POLICY_ACCEPTANCES {
        uuid id PK
        uuid user_id FK
        uuid policy_version_id FK
        boolean accepted
        timestamp accepted_at
    }

    ACCOUNT_DELETIONS {
        uuid id PK
        uuid user_id FK
        string status
        timestamp requested_at
        timestamp effective_at
        timestamp deleted_at
    }

    BREACH_INCIDENTS {
        uuid id PK
        string severity
        int estimated_users_count
        timestamp detected_at
        timestamp cnil_notified_at
        boolean user_notification_required
    }

    BREACH_AFFECTED_USERS {
        uuid id PK
        uuid breach_id FK
        uuid user_id FK
        timestamp notified_at
    }

    USER_PROFILE_HISTORY {
        uuid id PK
        uuid user_id FK
        string field_name
        text old_value
        text new_value
        timestamp changed_at
    }

    DATA_RETENTION_LOGS {
        uuid id PK
        string action_type
        int users_processed
        int users_deleted
        timestamp executed_at
    }

Légende

Entités de base :

  • USERS : Utilisateurs plateforme

    • Rôles : listener, creator, moderator, admin
    • Account status : active, suspended, grace_period, deleted
    • Trust score : 0-100 (anti-spam, accès fonctionnalités avancées)
  • CONTENTS : Contenus audio

    • Status : draft, pending_review, published, moderated, deleted
    • Moderation status : pending_review, approved, rejected
    • 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

Entités authentification & sécurité :

  • SESSIONS : Sessions utilisateur OAuth2/OIDC (détails)

    • Access token : 15 min, Refresh token : 30 jours (rotatif)
  • DEVICES : Appareils de confiance (détails)

    • Types : mobile, tablet, desktop, car
    • Appareils de confiance : bypass 2FA pendant 30 jours

Entités RGPD & conformité :

  • USER_CONSENTS : Consentements RGPD avec versioning (détails)

    • Types : geolocation_precise, analytics, push_notifications
  • LOCATION_HISTORY : Historique GPS avec anonymisation 24h (détails)

    • Geohash précision 5 (~5km²) après 24h
  • DATA_EXPORTS : Exports de données utilisateur (détails)

    • Portabilité RGPD Article 20, délai 48h max
  • PARENTAL_CONSENTS : Consentements parentaux 13-15 ans (détails)

    • Workflow validation email parent, token expire 7j
  • PARENTAL_CONTROLS : Paramètres contrôle parental (détails)

    • GPS, messagerie, contenus +16 configurables par parent
  • PRIVACY_POLICY_VERSIONS : Versioning politique confidentialité (détails)

    • Popup si changement majeur, historique acceptations
  • ACCOUNT_DELETIONS : Suppressions avec grace period 30j (détails)

    • Annulation possible, suppression effective automatique
  • BREACH_INCIDENTS : Registre violations de données (détails)

    • Procédure 72h CNIL, notification utilisateurs si risque élevé
  • USER_PROFILE_HISTORY : Audit trail modifications profil (détails)

    • Droit rectification Article 16, preuve légale
  • DATA_RETENTION_LOGS : Logs purges automatiques (détails)

    • Inactivité 5 ans, notifications 90j/30j/7j

Entités recommandation & modération :

  • INTEREST_GAUGES : Jauges de centres d'intérêt (détails)

    • Score 0-100 par catégorie (automobile, travel, music, etc.)
    • Algorithme : 70% géo + 30% intérêts
  • REPORTS : Signalements de contenu (détails)

    • Catégories : spam, hate_speech, violence, sexual_content, misinformation, etc.
    • Workflow modération avec priorisation