name = "control_center_configuration"
description = "Interactive configuration for Control Center service (policy and RBAC management)"
display_mode = "complete"
fallback_locale = "en-US"

# ============================================================================
# CONTROL CENTER SERVICE FORM - COMPOSED FROM FRAGMENTS
# ============================================================================
# This form uses fragment composition pattern for modular configuration
# All fragments are located in ./fragments/ subdirectory
# ============================================================================

# DEPLOYMENT MODE SELECTION
# Determines service resources and feature set (solo/multiuser/cicd/enterprise)
[[items]]
name = "deployment_mode_group"
type = "group"
title = "Deployment Configuration"
description = "Select deployment mode and database backend"
includes = ["fragments/deployment/mode-selection.toml", "fragments/deployment/database-backend-selection.toml"]

# WORKSPACE CONFIGURATION
# Workspace name, path, and context
[[items]]
name = "workspace_group"
type = "group"
title = "Workspace Settings"
description = "Configure workspace context for this Control Center instance"
includes = ["fragments/workspace-section.toml"]

# SERVER CONFIGURATION
# HTTP server settings (host, port, workers, connections)
[[items]]
name = "server_group"
type = "group"
title = "Server Settings"
description = "Configure HTTP server for Control Center"
includes = ["fragments/server-section.toml"]

# DATABASE BACKEND CONFIGURATION
# Conditional sections based on selected backend
[[items]]
name = "database_rocksdb_group"
type = "group"
title = "RocksDB Configuration"
description = "Configure RocksDB backend for policy storage"
condition = "database_backend_selection == 'rocksdb'"
includes = ["fragments/database-rocksdb-section.toml"]

[[items]]
name = "database_surrealdb_group"
type = "group"
title = "SurrealDB Configuration"
description = "Configure SurrealDB backend for policy storage"
condition = "database_backend_selection == 'surrealdb_embedded' || database_backend_selection == 'surrealdb_server'"
includes = ["fragments/database-surrealdb-section.toml"]

[[items]]
name = "database_postgres_group"
type = "group"
title = "PostgreSQL Configuration"
description = "Configure PostgreSQL backend for policy storage"
condition = "database_backend_selection == 'postgresql'"
includes = ["fragments/database-postgres-section.toml"]

# CONTROL CENTER-SPECIFIC: SECURITY CONFIGURATION
# JWT, RBAC, MFA, rate limiting, TLS, sessions
[[items]]
name = "security_group"
type = "group"
title = "Security Configuration"
description = "Configure authentication, authorization, and security settings"
includes = ["fragments/control-center/security-section.toml"]

# CONTROL CENTER-SPECIFIC: POLICY CONFIGURATION
# Policy caching, versioning, management
[[items]]
name = "policy_group"
type = "group"
title = "Policy Configuration"
description = "Configure policy engine and policy management"
includes = ["fragments/control-center/policy-section.toml"]

# CONTROL CENTER-SPECIFIC: USER MANAGEMENT CONFIGURATION
# User registration, sessions, audit logging
[[items]]
name = "users_group"
type = "group"
title = "User Management Configuration"
description = "Configure user registration, sessions, and audit"
includes = ["fragments/control-center/users-section.toml"]

# CONTROL CENTER-SPECIFIC: COMPLIANCE & AUDIT CONFIGURATION
# Audit logging, compliance frameworks, data retention, encryption
[[items]]
name = "compliance_group"
type = "group"
title = "Compliance & Audit Configuration"
description = "Configure audit logging, compliance, and data retention"
includes = ["fragments/control-center/compliance-section.toml"]

# MONITORING CONFIGURATION
# Metrics collection, health checks
[[items]]
name = "monitoring_group"
type = "group"
title = "Monitoring Configuration"
description = "Configure metrics and health checks"
includes = ["fragments/monitoring-section.toml"]

# LOGGING CONFIGURATION
# Log levels, formats, rotation
[[items]]
name = "logging_group"
type = "group"
title = "Logging Configuration"
description = "Configure logging behavior and output"
includes = ["fragments/logging-section.toml"]
