use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct EnterpriseConfig {
#[serde(default)]
pub enabled: bool,
pub sso: Option<SsoConfig>,
#[serde(default)]
pub audit_logging: bool,
#[serde(default)]
pub advanced_analytics: bool,
}
#[allow(dead_code)]
impl EnterpriseConfig {
pub fn merge(mut self, other: Self) -> Self {
if other.enabled {
self.enabled = other.enabled;
}
if other.sso.is_some() {
self.sso = other.sso;
}
if other.audit_logging {
self.audit_logging = other.audit_logging;
}
if other.advanced_analytics {
self.advanced_analytics = other.advanced_analytics;
}
self
}
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct SsoConfig {
pub provider: String,
pub client_id: String,
pub client_secret: String,
pub redirect_url: String,
#[serde(default)]
pub settings: std::collections::HashMap<String, serde_json::Value>,
}