@startuml hide circle skinparam linetype ortho skinparam classAttributeIconSize 0 ' ========================= ' TABLES RAW ' ========================= class raw_employees { + id : SERIAL <> -- employee_external_id : INTEGER <> age : INTEGER genre : VARCHAR(20) statut_marital : VARCHAR(50) ayant_enfants : VARCHAR(10) niveau_education : INTEGER domaine_etude : VARCHAR(120) departement : VARCHAR(120) poste : VARCHAR(120) distance_domicile_travail : INTEGER created_at : TIMESTAMPTZ <> } class raw_employee_snapshots { + id : SERIAL <> -- employee_id : INTEGER <> nombre_experiences_precedentes : INTEGER nombre_heures_travaillees : INTEGER annee_experience_totale : INTEGER annees_dans_l_entreprise : INTEGER annees_dans_le_poste_actuel : INTEGER annees_sous_responsable_actuel : INTEGER niveau_hierarchique_poste : INTEGER revenu_mensuel : INTEGER augmentation_salaire_precedente : VARCHAR(50) heures_supplementaires : VARCHAR(50) nombre_participation_pee : INTEGER nb_formations_suivies : INTEGER nombre_employee_sous_responsabilite : INTEGER frequence_deplacement : VARCHAR(50) annees_depuis_la_derniere_promotion : INTEGER created_at : TIMESTAMPTZ <> } class raw_surveys { + id : SERIAL <> -- employee_id : INTEGER <> code_sondage : INTEGER eval_number : VARCHAR(50) note_evaluation_precedente : INTEGER note_evaluation_actuelle : INTEGER satisfaction_employee_environnement : INTEGER satisfaction_employee_nature_travail : INTEGER satisfaction_employee_equipe : INTEGER satisfaction_employee_equilibre_pro_perso : INTEGER created_at : TIMESTAMPTZ <> } class ground_truth { + id : SERIAL <> -- employee_id : INTEGER <> date_event : TIMESTAMPTZ <> a_quitte_l_entreprise : INTEGER <> created_at : TIMESTAMPTZ <> } raw_employee_snapshots }o--|| raw_employees : employee_id → raw_employees.id\n(on delete cascade) raw_surveys }o--|| raw_employees : employee_id → raw_employees.id\n(on delete cascade) ground_truth }o--|| raw_employees : employee_id → raw_employees.id\n(on delete cascade) ' ========================= ' TABLE CONTRACTUELLE ML ' ========================= class ml_features_employees { + id : BIGSERIAL <> created_at : TIMESTAMPTZ <> -- note_evaluation_precedente : SMALLINT <> niveau_hierarchique_poste : SMALLINT <> note_evaluation_actuelle : SMALLINT <> heures_supplementaires : SMALLINT <> augmentation_salaire_precedente : NUMERIC(10,2) <> age : SMALLINT <> genre : SMALLINT <> revenu_mensuel : INTEGER <> statut_marital : VARCHAR(50) <> departement : VARCHAR(120) <> poste : VARCHAR(120) <> nombre_experiences_precedentes : SMALLINT <> annee_experience_totale : SMALLINT <> annees_dans_l_entreprise : SMALLINT <> annees_dans_le_poste_actuel : SMALLINT <> a_quitte_l_entreprise : SMALLINT <> nombre_participation_pee : SMALLINT <> nb_formations_suivies : SMALLINT <> distance_domicile_travail : SMALLINT <> niveau_education : SMALLINT <> domaine_etude : VARCHAR(120) <> frequence_deplacement : SMALLINT <> annees_depuis_la_derniere_promotion : SMALLINT <> annees_sous_responsable_actuel : SMALLINT <> satisfaction_moyenne : NUMERIC(10,4) <> nonlineaire_participation_pee : NUMERIC(18,16) <> ratio_heures_sup_salaire : NUMERIC(18,16) <> nonlinaire_charge_contrainte : NUMERIC(18,16) <> nonlinaire_surmenage_insatisfaction : NUMERIC(18,16) <> jeune_surcharge : SMALLINT <> anciennete_sans_promotion : NUMERIC(18,16) <> mobilite_carriere : NUMERIC(18,16) <> risque_global : NUMERIC(18,16) <> } ' ========================= ' HISTORIQUE DES PREDICTIONS ' ========================= class prediction_requests { + id : SERIAL <> -- employee_id : INTEGER <> snapshot_id : INTEGER <> survey_id : INTEGER <> payload_json : JSONB <> created_at : TIMESTAMPTZ <> } class predictions { + id : SERIAL <> -- request_id : INTEGER <> model_version : VARCHAR(50) <> predicted_class : INTEGER <> predicted_proba : DOUBLE PRECISION <> threshold_used : DOUBLE PRECISION <> latency_ms : INTEGER created_at : TIMESTAMPTZ <> } predictions }o--|| prediction_requests : request_id → prediction_requests.id\n(on delete cascade) prediction_requests }o--o| raw_employees : employee_id → raw_employees.id\n(on delete set null) prediction_requests }o--o| raw_employee_snapshots : snapshot_id → raw_employee_snapshots.id\n(on delete set null) prediction_requests }o--o| raw_surveys : survey_id → raw_surveys.id\n(on delete set null) @enduml