from dataclasses import dataclass
import os


@dataclass
class Settings:
    schoolhouse_host: str = os.getenv("SCHOOLHOUSE_HOST", "0.0.0.0")
    schoolhouse_port: int = int(os.getenv("SCHOOLHOUSE_PORT", "8091"))
    schoolhouse_base_url: str = os.getenv("SCHOOLHOUSE_BASE_URL", "http://localhost:8091")
    database_url: str = os.getenv("DATABASE_URL", "postgresql+psycopg://schoolhouse:changeme@shared-postgres:5432/schoolhouse")
    paperless_base_url: str = os.getenv("PAPERLESS_BASE_URL", "https://paperless.example.com")
    paperless_api_token: str = os.getenv("PAPERLESS_API_TOKEN", "changeme")
    n8n_base_url: str = os.getenv("N8N_BASE_URL", "https://n8n.example.com")
    n8n_assignment_webhook: str = os.getenv("SCHOOLHOUSE_N8N_ASSIGNMENT_WEBHOOK", "/webhook/school/intake/upload")
    n8n_recording_webhook: str = os.getenv("SCHOOLHOUSE_N8N_RECORDING_WEBHOOK", "/webhook/class/upload")
    d2l_scraper_workdir: str = os.getenv("D2L_SCRAPER_WORKDIR", "/workspace/.openclaw-workspace/school")
    d2l_scraper_command: str = os.getenv("D2L_SCRAPER_COMMAND", "node d2l_scraper_final.js")
    upload_tmp_dir: str = os.getenv("UPLOAD_TMP_DIR", "/data/uploads")
    state_dir: str = os.getenv("SCHOOLHOUSE_STATE_DIR", "/data/state")
    storage_backend: str = os.getenv("SCHOOLHOUSE_STORAGE_BACKEND", "auto")
    max_upload_mb: int = int(os.getenv("MAX_UPLOAD_MB", "1536"))


settings = Settings()
