from pathlib import Path

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

SECRET_KEY = ''

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

ALLOWED_HOSTS = []

CSRF_TRUSTED_ORIGINS = [] # put same than above

SITE_NAME = 'local'

#ADMINS = [('Laurent', 'laurent@padelclub.app'), ('Razmig', 'razmig@padelclub.app')]

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': BASE_DIR / 'db.sqlite3',
        'ATOMIC_REQUESTS': True,
    }
}

# CHANNEL_LAYERS = {
#     "default": {
#         "BACKEND": "channels.layers.InMemoryChannelLayer"
#     }
# }

# CHANNEL_LAYERS = {
#     "default": {
#         "BACKEND": "channels_redis.core.RedisChannelLayer",
#         "CONFIG": {
#             "hosts": [("localhost", 8300)],
#         },
#     },
# }
STRIPE_MODE = 'test'
STRIPE_PUBLISHABLE_KEY = ''
STRIPE_SECRET_KEY = ''
SHOP_STRIPE_WEBHOOK_SECRET = 'whsec_...'  # Your existing webhook secret
TOURNAMENT_STRIPE_WEBHOOK_SECRET = 'whsec_...'  # New webhook secret for tournaments
STRIPE_FEE = 0.0075
TOURNAMENT_SETTINGS = {
    'TIME_PROXIMITY_RULES': {
        24: 30,    # within 24h → 30 min
        48: 60,    # within 48h → 60 min
        72: 120,   # within 72h → 120 min
        'default': 240
    },
    'WAITING_LIST_RULES': {
        30: 30,    # 30+ teams → 30 min
        20: 60,    # 20+ teams → 60 min
        10: 120,   # 10+ teams → 120 min
        'default': 240
    },
    'BUSINESS_RULES': {
        'hours': {
            'start': 8,     # 8:00
            'end': 21,      # 21:00
        }
    },
    'MINIMUM_RESPONSE_TIME': 30, # requires to be like the BACKGROUND_SCHEDULED_TASK_INTERVAL
}

BACKGROUND_SCHEDULED_TASK_INTERVAL = 30  # minutes
LIVE_TESTING = False
