"""
Storm Development QA System Interfaces
Defines contracts for dependency injection and testing
"""

from abc import ABC, abstractmethod
from typing import Optional, List, Dict, Any


class ConsoleInterface(ABC):
    """Interface for console output systems"""
    
    @abstractmethod
    def print(self, *args, **kwargs):
        """Generic print method"""
        pass
    
    @abstractmethod
    def print_header(self, title: str, subtitle: Optional[str] = None):
        """Print professional header"""
        pass
    
    @abstractmethod
    def print_business_context(self, context: str, technology: str = "django"):
        """Print business context information"""
        pass
    
    @abstractmethod
    def print_analysis(self, analysis_type: str, details: str):
        """Print analysis information"""
        pass
    
    @abstractmethod
    def print_error(self, error_type: str, message: str, guidance: Optional[str] = None):
        """Print error information"""
        pass
    
    @abstractmethod
    def print_session_summary(self, tests_run: int, passed: int, failed: int, duration: float):
        """Print test session summary"""
        pass
    
    @abstractmethod
    def print_business_recommendation(self, title: str, recommendations: List[str]):
        """Print business recommendations"""
        pass


class TestCategorizerInterface(ABC):
    """Interface for test categorization systems"""
    
    @abstractmethod
    def categorize_test(self, test_name: str, test_path: str = "") -> Dict[str, Any]:
        """Categorize a test and return business context"""
        pass
    
    @abstractmethod
    def get_learning_path(self, category: str) -> List[str]:
        """Get learning resources for a category"""
        pass
    
    @abstractmethod
    def get_resolution_guidance(self, category: str) -> Dict[str, str]:
        """Get resolution guidance for a category"""
        pass


class FailureAnalyzerInterface(ABC):
    """Interface for test failure analysis systems"""
    
    @abstractmethod
    def analyze_failure(self, test_name: str, error_type: str, 
                       error_message: str, traceback: List[str]) -> Dict[str, Any]:
        """Analyze a test failure and provide guidance"""
        pass
    
    @abstractmethod
    def generate_resolution_steps(self, error_type: str, 
                                 error_message: str) -> List[str]:
        """Generate specific resolution steps"""
        pass
    
    @abstractmethod
    def generate_qa_guidance(self, error_type: str, 
                           error_message: str) -> Dict[str, str]:
        """Generate QA learning guidance"""
        pass


class LoggerInterface(ABC):
    """Interface for logging systems"""
    
    @abstractmethod
    def info(self, message: str, **kwargs):
        """Log info message"""
        pass
    
    @abstractmethod
    def error(self, message: str, **kwargs):
        """Log error message"""
        pass
    
    @abstractmethod
    def warning(self, message: str, **kwargs):
        """Log warning message"""
        pass
    
    @abstractmethod
    def debug(self, message: str, **kwargs):
        """Log debug message"""
        pass
    
    @abstractmethod
    def log(self, level: int, message: str, **kwargs):
        """Log at specific level"""
        pass