"""
Feature flags for enterprise tier functionality
"""

import os
from typing import Dict, Any


class FeatureFlags:
    """Enterprise feature flags configuration"""
    
    # Main enterprise tier feature flag
    ENABLE_ENTERPRISE_TIER = os.getenv("ENABLE_ENTERPRISE_TIER", "true").lower() == "true"
    
    # Internal transfer feature flag
    ENABLE_INTERNAL_TRANSFERS = os.getenv("ENABLE_INTERNAL_TRANSFERS", "true").lower() == "true"
    
    # Distribution service feature flag
    ENABLE_DISTRIBUTION_SERVICE = os.getenv("ENABLE_DISTRIBUTION_SERVICE", "true").lower() == "true"
    
    # Network dashboard feature flag
    ENABLE_NETWORK_DASHBOARD = os.getenv("ENABLE_NETWORK_DASHBOARD", "true").lower() == "true"
    
    # Child tenant management feature flag
    ENABLE_CHILD_TENANT_MANAGEMENT = os.getenv("ENABLE_CHILD_TENANT_MANAGEMENT", "true").lower() == "true"
    
    # Aggregated forecasting feature flag
    ENABLE_AGGREGATED_FORECASTING = os.getenv("ENABLE_AGGREGATED_FORECASTING", "true").lower() == "true"
    
    @classmethod
    def get_all_flags(cls) -> Dict[str, Any]:
        """Get all feature flags as a dictionary"""
        return {
            'ENABLE_ENTERPRISE_TIER': cls.ENABLE_ENTERPRISE_TIER,
            'ENABLE_INTERNAL_TRANSFERS': cls.ENABLE_INTERNAL_TRANSFERS,
            'ENABLE_DISTRIBUTION_SERVICE': cls.ENABLE_DISTRIBUTION_SERVICE,
            'ENABLE_NETWORK_DASHBOARD': cls.ENABLE_NETWORK_DASHBOARD,
            'ENABLE_CHILD_TENANT_MANAGEMENT': cls.ENABLE_CHILD_TENANT_MANAGEMENT,
            'ENABLE_AGGREGATED_FORECASTING': cls.ENABLE_AGGREGATED_FORECASTING,
        }
    
    @classmethod
    def is_enabled(cls, flag_name: str) -> bool:
        """Check if a specific feature flag is enabled"""
        return getattr(cls, flag_name, False)


# Export the feature flags
__all__ = ["FeatureFlags"]