import os
from pathlib import Path

BASE_DIR = Path(__file__).resolve().parent

APP_NAME = "KontaktWerk"
APP_VERSION = "1.0.0"

DB_PATH = BASE_DIR / "data" / "kontaktwerk.db"
DATABASE_URL = f"sqlite:///{DB_PATH}"

UPLOAD_DIR = BASE_DIR / "uploads"
LOG_DIR = BASE_DIR / "logs"

SECRET_KEY = os.environ.get("CRM_SECRET_KEY", "kontaktwerk-secret-change-in-production")
SESSION_COOKIE = "kontaktwerk_session"
SESSION_MAX_AGE = 60 * 60 * 24 * 7  # 7 Tage

ITEMS_PER_PAGE = 25
SEARCH_DEBOUNCE_MS = 200
SEARCH_MAX_LIVE_RESULTS = 10

GRUPPEN_SEED = []

AKTIVITAET_ART_MAPPING = {
    "EA": "email_aus",
    "T": "telefon",
    "P": "persoenlich",
    "EE": "email_ein",
    "SB": "serienbrief",
    "S": "schriftverkehr",
    "AZ": "aufgabe",
    "BE": "bewerbung",
    "EB": "brief_ein",
    "FA": "fax_aus",
}
