"""
Security API - Shared Pydantic Models

Data models used across security_api, security_mock_data, and security_monitoring.
"""

from typing import Optional
from pydantic import BaseModel


class ToolStatus(BaseModel):
    name: str
    installed: bool
    version: Optional[str] = None
    last_run: Optional[str] = None
    last_findings: int = 0


class Finding(BaseModel):
    id: str
    tool: str
    severity: str
    title: str
    message: Optional[str] = None
    file: Optional[str] = None
    line: Optional[int] = None
    found_at: str


class SeveritySummary(BaseModel):
    critical: int = 0
    high: int = 0
    medium: int = 0
    low: int = 0
    info: int = 0
    total: int = 0


class ScanResult(BaseModel):
    tool: str
    status: str
    started_at: str
    completed_at: Optional[str] = None
    findings_count: int = 0
    report_path: Optional[str] = None


class HistoryItem(BaseModel):
    timestamp: str
    title: str
    description: str
    status: str  # success, warning, error
