# /opt/docker/dev/service_finder/backend/app/schemas/finance.py
"""
Finance-related Pydantic schemas for API requests and responses.
"""

from pydantic import BaseModel, ConfigDict
from datetime import datetime
from typing import Optional, Any, Dict, List
import enum


class IssuerType(str, enum.Enum):
    """Kibocsátó típusok (jogi forma)."""
    KFT = "KFT"
    EV = "EV"
    BT = "BT"
    ZRT = "ZRT"
    OTHER = "OTHER"


class IssuerResponse(BaseModel):
    """Response schema for Issuer entities."""
    id: int
    name: str
    tax_id: Optional[str] = None
    type: IssuerType
    revenue_limit: float
    current_revenue: float
    is_active: bool
    api_config: Dict[str, Any]
    created_at: datetime
    updated_at: datetime

    model_config = ConfigDict(from_attributes=True)


class IssuerUpdate(BaseModel):
    """Update schema for Issuer entities (PATCH)."""
    is_active: Optional[bool] = None
    revenue_limit: Optional[float] = None
    api_config: Optional[Dict[str, Any]] = None

    model_config = ConfigDict(from_attributes=True)