Tables de faits
Cette documentation cartographie les tables de faits (préfixées fact_) du datawarehouse.
Elle décrit l'objectif de chaque table et le format attendu des colonnes (noms et types).
Remarques générales
- Les colonnes
dw_inserted_atetdw_updated_atsont des métadonnées DW (timestamps d'ingestion/mise à jour). - Les colonnes
version,date_from,date_toservent à historiser les faits (SCD / HOP) lorsque nécessaire. - Les clés étrangères vers les dimensions utilisent le suffixe
_key.
sim_time
Table technique spécifique pour récupérer le temps NOW() de la clock. Cette table contient une seule ligne mise à jour par le backend.
sim_id : int
sim_now : timestamp
sim_updated : timestamp
Exemple :
1 | 2025-11-16 19:02:43.390075 | 2025-11-16 19:02:43.390075
fact_commandes_ecommerce
Table vide pour l'instant (workflow HOP non défini).
Relations : dim_date, dim_temp
commande_key : bigint
commande_id_source : bigint
client_id_source : bigint
date_key : int
time_key : int
montant_total_cents : bigint
statut_commande : string
transporteur : string
delai_livraison_estime : interval
date_confirmation : timestamp
date_expedition : timestamp
date_livraison : timestamp
date_refus : timestamp
numero_suivi : string
url_suivi : string
message_refus : string
application : string
dw_inserted_at : timestamp
dw_updated_at : timestamp
version : int
date_from : date
date_to : date
fact_event_ticket_sav
Événements liés aux tickets SAV. Chaque ligne représente un événement dans le cycle de vie d'un ticket.
Relations : dim_ticket_sav, dim_event_type_sav, dim_date, dim_temp
event_fact_key : bigint
ticket_key : bigint
event_type_key : bigint
date_event_key : int
time_event_key : int
timestamp_event : timestamp
duree_depuis_event_precedent : numeric
fact_paiements
Table vide pour l'instant (workflow HOP non défini).
Relations : dim_date, dim_magasin
paiement_key : bigint
paiement_id_source : bigint
vente_key : bigint
magasin_key : bigint
date_key : int
montant_cents : bigint
methode_paiement : string
statut_paiement : string
reference : string
application : string
dw_inserted_at : timestamp
dw_updated_at : timestamp
version : int
date_from : date
date_to : date
fact_restock_items
Table vide pour l'instant (workflow HOP non défini).
Relations : dim_produit, dim_magasin, dim_entrepot, dim_fournisseurs
fact_restock_key : int
id_source : bigint
created_at : timestamp
updated_at : timestamp
deleted_at : timestamp
restock_id : bigint
produit_key : bigint
quantity : int
fournisseur_key : int
magasin_key : bigint
entrepot_key : bigint
supplier_delay_days : int
status : string
delivery_date : timestamp
fact_stock_entrepot
État actuel des stocks dans les entrepôts. Une ligne par couple (produit, entrepôt).
Relations : dim_produit, dim_entrepot
fact_stock_entrepot_key : int
produit_key : bigint
entrepot_key : bigint
quantity : int
id_source : int
created_at : timestamp
updated_at : timestamp
deleted_at : timestamp
product_name : string
product_ean : string
price_cents : int
last_updated_at : timestamp
fact_stock_historique
Historique des stocks. À chaque appel, une mesure des stocks est enregistrée pour tracer l'évolution dans le temps.
Relations : dim_produit, dim_entrepot, dim_magasin
stock_pk : int
quantity : bigint
price_cents : int
id_source : int
origin_type : string -- 'MAGASIN' ou 'ENTREPOT'
product_name : string
product_ean : string
date_import : date
magasin_key : bigint
entrepot_key : bigint
produit_key : bigint
fact_stock_magasin
État actuel des stocks dans les magasins. Une ligne par couple (produit, magasin).
Relations : dim_produit, dim_magasin
fact_stock_magasin_key : bigint
produit_key : bigint
magasin_key : bigint
quantity : int
id_source : int
created_at : timestamp
updated_at : timestamp
deleted_at : timestamp
product_name : string
product_ean : string
price_cents : int
last_updated_at : timestamp
fact_ticket_sav
Vue agrégée des tickets SAV avec métriques calculées (durée de résolution, nombre d'événements, etc.).
Relations : dim_ticket_sav, dim_client, dim_produit, dim_status_ticket_sav, dim_date, dim_temp, dim_payment_status_sav, dim_exchange_status_sav
ticket_fact_key : bigint
ticket_key : bigint
client_key : bigint
produit_key : bigint
statut_key : bigint
date_ouverture_key : int
date_cloture_key : int
time_ouverture_key : int
time_cloture_key : int
duree_resolution_heures : numeric
nb_evenements : int
nb_reouvertures : int
temps_moyen_entre_event : numeric
load_date : timestamp
source_system : string
payment_status_key : int
exchange_status_key : int
purchase_date_key : int
fact_ventes_magasin
Ventes réalisées en magasin. Chaque ligne représente une ligne de vente (produit vendu).
Relations : dim_date, dim_temp, dim_magasin, dim_produit
vente_magasin_key : bigint
vente_id_source : bigint
date_key : int
time_key : int
magasin_key : bigint
produit_key : int
quantite : int
prix_unitaire_cents : bigint
montant_total_cents : bigint
remise_cents : bigint
statut_vente : string
application : string
dw_inserted_at : timestamp
dw_updated_at : timestamp
version : int
date_from : date
date_to : date