"""
Common (shared enums and pagination) Pydantic schemas — extracted from compliance/api/schemas.py.

Phase 1 Step 3: the monolithic ``compliance.api.schemas`` module is being
split per domain under ``compliance.schemas``. This module is re-exported
from ``compliance.api.schemas`` for backwards compatibility.
"""

from datetime import datetime, date
from typing import Optional, List, Any, Dict

from pydantic import BaseModel, ConfigDict, Field


# ============================================================================
# Enums as strings for API
# ============================================================================

class RegulationType(str):
    EU_REGULATION = "eu_regulation"
    EU_DIRECTIVE = "eu_directive"
    DE_LAW = "de_law"
    BSI_STANDARD = "bsi_standard"
    INDUSTRY_STANDARD = "industry_standard"


class ControlType(str):
    PREVENTIVE = "preventive"
    DETECTIVE = "detective"
    CORRECTIVE = "corrective"


class ControlDomain(str):
    GOVERNANCE = "gov"
    PRIVACY = "priv"
    IAM = "iam"
    CRYPTO = "crypto"
    SDLC = "sdlc"
    OPS = "ops"
    AI = "ai"
    CRA = "cra"
    AUDIT = "aud"


class ControlStatus(str):
    PASS = "pass"
    PARTIAL = "partial"
    FAIL = "fail"
    NOT_APPLICABLE = "n/a"
    PLANNED = "planned"


class RiskLevel(str):
    LOW = "low"
    MEDIUM = "medium"
    HIGH = "high"
    CRITICAL = "critical"


class EvidenceStatus(str):
    VALID = "valid"
    EXPIRED = "expired"
    PENDING = "pending"
    FAILED = "failed"


# ============================================================================
# Pagination Schemas (defined here, completed after Response classes)
# ============================================================================

class PaginationMeta(BaseModel):
    """Pagination metadata for list responses."""
    page: int
    page_size: int
    total: int
    total_pages: int
    has_next: bool
    has_prev: bool

