"""
config.py
---------
All the settings that make ONE CLUB's copy of this app different from another
club's copy live here. When we turn this into a true multi-club template,
this is the file each club gets its own version of (kept OUT of git so
template updates never overwrite a club's personalisation).

For now, while we're building the single-club template, sensible defaults
are hard-coded below. Nothing here needs to change until you're ready to
actually deploy a real club.
"""

import os

# The folder this config file lives in — used to build absolute paths below
# so the app works no matter what directory you launch it from.
BASE_DIR = os.path.abspath(os.path.dirname(__file__))


class Config:
    # --- Club identity (shown in page titles, emails, etc.) ---
    CLUB_NAME = "Sample Golf Club"
    CLUB_CONTACT_EMAIL = "info@samplegolfclub.example"

    # --- Security ---
    # SECRET_KEY is used by Flask to sign session cookies and CSRF tokens.
    # In production this MUST be overridden with a long random value set as
    # an environment variable — never leave the fallback value below in use
    # on a real server.
    SECRET_KEY = os.environ.get("SECRET_KEY", "dev-only-change-this-before-deploying")

    # --- Database ---
    # SQLite stores the whole database as a single file on disk — no
    # separate database server to install, patch, or secure.
    # The file will live in the "instance" folder, which Flask treats as a
    # safe place for files that shouldn't be committed to git (since each
    # club's data is unique to them).
    SQLALCHEMY_DATABASE_URI = "sqlite:///" + os.path.join(BASE_DIR, "instance", "club.db")

    # Turning this off avoids a warning and a small performance cost — we
    # don't need SQLAlchemy's built-in change-tracking feature.
    SQLALCHEMY_TRACK_MODIFICATIONS = False
