import os
from pathlib import Path

from dotenv import load_dotenv

env_path = Path(".") / ".env"
load_dotenv(dotenv_path=env_path)


class Settings:
    PROJECT_NAME: str = "Kontor"
    PROJECT_VERSION: str = "0.3.0"

    DB_USER: str = os.getenv("DB_USER", "kontor")
    DB_PASSWORD: str = os.getenv("DB_PASSWORD", "kontor")
    DB_SERVER: str = os.getenv("DB_SERVER", "postgres")
    DB_PORT: int = int(os.getenv("DB_PORT", 5432))
    DB_DBNAME: str = os.getenv("DB_DBNAME", "kontor")
    DATABASE_URL: str = f"postgresql://{DB_USER}:{DB_PASSWORD}@{DB_SERVER}:{DB_PORT}/{DB_DBNAME}"
    SECRET_KEY: str = os.getenv("SECRET_KEY", "J6GOtcwC2NJI1l0VkHu20PacPFGTxpirBxWwynoHjsc=")
    ALGORITHM = "HS256"
    ACCESS_TOKEN_EXPIRE_MINUTES = 60*24*7  # one week in mins

settings = Settings()

