use std::collections::HashMap;
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct IntermediateFactTable {
pub table_name: String,
pub measures: Vec<IntermediateMeasure>,
pub dimensions: IntermediateDimensions,
pub denormalized_filters: Vec<IntermediateFilter>,
#[serde(default)]
pub native_measures: HashMap<String, String>,
#[serde(default)]
pub native_dimension_mapping: HashMap<String, String>,
}
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct IntermediateMeasure {
pub name: String,
pub sql_type: String,
pub nullable: bool,
}
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct IntermediateDimensions {
pub name: String,
pub paths: Vec<IntermediateDimensionPath>,
}
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct IntermediateDimensionPath {
pub name: String,
#[serde(alias = "path")]
pub json_path: String,
#[serde(alias = "type")]
pub data_type: String,
}
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct IntermediateFilter {
pub name: String,
pub sql_type: String,
pub indexed: bool,
}
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct IntermediateAggregateQuery {
pub name: String,
pub fact_table: String,
pub auto_group_by: bool,
pub auto_aggregates: bool,
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
}