import os

# Define the application directory
BASE_DIR = os.path.abspath(os.path.dirname(__file__))

# Statement for enabling the development environment
DEBUG = True

# Application threads. A common general assumption is
# using 2 per available processor cores - to handle
# incoming requests using one and performing background
# operations using the other.
THREADS_PER_PAGE = 2

# Enable protection agains *Cross-site Request Forgery (CSRF)*
CSRF_ENABLED = True

# Use a secure, unique and absolutely secret key for
# signing the data.
CSRF_SESSION_KEY = "secret"

# Secret key for signing cookies
SECRET_KEY = "secret"

# CUSTOM CONFIG
MQTT_BROKER_URL = "127.0.0.1"
MQTT_BROKER_PORT = 1883
MQTT_KEEPALIVE = 30
PRINTER_TIMEOUT = 10
PRINTER_ATTEMPTS = 3
PRINTER_ATTEMPT_AFTER = 5
TICKET_TIMEOUT = 1

# SQLALCHEMY
SQLALCHEMY_DATABASE_URI = "sqlite:///" + os.path.join(
    BASE_DIR, "app/data/", "kds.db"
)
SQLALCHEMY_TRACK_MODIFICATIONS = False
SQLALCHEMY_ECHO = False

# KDS CONFIG
KDS_API_SERVER = "127.0.0.1"
KDS_API_PORT = "5000"
KDS_API_URL = "/mqtt"
