"""Settings — 환경변수 로드. TM_ 접두사로 ai_trade와 분리."""
from __future__ import annotations

import os
from dataclasses import dataclass


@dataclass
class Settings:
    nas_base_url: str
    webai_api_key: str
    redis_url: str
    kis_app_key: str
    kis_app_secret: str
    kis_account: str
    kis_is_virtual: bool
    loop_interval: int
    climax_vol_mult: float


def load_settings() -> Settings:
    return Settings(
        nas_base_url=os.getenv("NAS_BASE_URL", "http://192.168.45.54:18500"),
        webai_api_key=os.getenv("WEBAI_API_KEY", ""),
        redis_url=os.getenv("REDIS_URL", "redis://192.168.45.54:6379"),
        kis_app_key=os.getenv("TM_KIS_APP_KEY", ""),
        kis_app_secret=os.getenv("TM_KIS_APP_SECRET", ""),
        kis_account=os.getenv("TM_KIS_ACCOUNT", ""),
        kis_is_virtual=os.getenv("TM_KIS_IS_VIRTUAL", "0") == "1",
        loop_interval=int(os.getenv("TM_LOOP_INTERVAL", "60")),
        climax_vol_mult=float(os.getenv("TM_CLIMAX_VOL_MULT", "3.0")),
    )
