from pydantic_settings import BaseSettings


class Settings(BaseSettings):
    # snpdb (궤적 데이터 소스)
    SNPDB_HOST: str = '211.208.115.83'
    SNPDB_PORT: int = 5432
    SNPDB_NAME: str = 'snpdb'
    SNPDB_USER: str = 'snp'
    SNPDB_PASSWORD: str

    # kcgdb (분석 결과 저장)
    KCGDB_HOST: str = '211.208.115.83'
    KCGDB_PORT: int = 5432
    KCGDB_NAME: str = 'kcgdb'
    KCGDB_SCHEMA: str = 'kcg'
    KCGDB_USER: str = 'kcg_app'
    KCGDB_PASSWORD: str

    # 스케줄러
    SCHEDULER_INTERVAL_MIN: int = 5

    # 인메모리 캐시
    CACHE_WINDOW_HOURS: int = 24
    INITIAL_LOAD_HOURS: int = 24
    STATIC_INFO_REFRESH_MIN: int = 60
    PERMIT_REFRESH_MIN: int = 30

    # 파이프라인
    TRAJECTORY_HOURS: int = 6
    MMSI_PREFIX: str = '412'
    MIN_TRAJ_POINTS: int = 100

    # 로깅
    LOG_LEVEL: str = 'INFO'

    model_config = {'env_file': '.env', 'env_file_encoding': 'utf-8', 'extra': 'ignore'}


settings = Settings()
