from pydantic import BaseModel
from typing import Optional
from datetime import datetime


class SystemSettingsUpdate(BaseModel):
    """시스템 설정 수정용 스키마"""
    search_page_size: Optional[int] = None
    korea_margin_percent: Optional[float] = None
    mongolia_margin_percent: Optional[float] = None
    cc_per_usdc: Optional[int] = None
    cc_per_view: Optional[int] = None
    cc_signup_bonus: Optional[int] = None
    cars_per_cc: Optional[int] = None
    cache_ttl_hours: Optional[int] = None
    container_logistics_usd: Optional[int] = None
    shoring_cost_usd: Optional[int] = None


class SystemSettingsResponse(BaseModel):
    """시스템 설정 응답 스키마"""
    id: int
    search_page_size: int
    korea_margin_percent: float
    mongolia_margin_percent: float
    cc_per_usdc: int
    cc_per_view: int
    cc_signup_bonus: int
    cars_per_cc: int
    cache_ttl_hours: int
    container_logistics_usd: int
    shoring_cost_usd: int
    created_at: Optional[datetime] = None
    updated_at: Optional[datetime] = None

    class Config:
        from_attributes = True
