# /opt/docker/dev/service_finder/backend/app/schemas/system.py
from pydantic import BaseModel, ConfigDict
from typing import Dict, Any, Optional
from datetime import datetime


class SystemParameterBase(BaseModel):
    description: Optional[str] = None
    value: Dict[str, Any]  # JSONB mező
    scope_level: str = 'global'
    scope_id: Optional[str] = None
    is_active: bool = True


class SystemParameterCreate(SystemParameterBase):
    key: str


class SystemParameterUpdate(BaseModel):
    description: Optional[str] = None
    value: Optional[Dict[str, Any]] = None
    is_active: Optional[bool] = None


class SystemParameterResponse(SystemParameterBase):
    id: int
    key: str
    updated_at: datetime
    
    model_config = ConfigDict(from_attributes=True)