|
|
|
|
@ -1490,40 +1490,11 @@ class Tournament(BaseModel): |
|
|
|
|
if waiting_list_count == 0: |
|
|
|
|
return None |
|
|
|
|
|
|
|
|
|
# Configuration rules |
|
|
|
|
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 |
|
|
|
|
"default_confirmation_hour": 8 # When extending to next day |
|
|
|
|
}, |
|
|
|
|
"days": { |
|
|
|
|
"working_days": [0, 1, 2, 3, 4, 5, 6], # Monday = 0, Friday = 4 |
|
|
|
|
"weekend": [] # Saturday = 5, Sunday = 6 |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
URGENCY_OVERRIDE = { |
|
|
|
|
"thresholds": { |
|
|
|
|
24: True, # If ≤ 24h until tournament: ignore business hours |
|
|
|
|
12: True # If ≤ 12h until tournament: ignore all restrictions |
|
|
|
|
}, |
|
|
|
|
"minimum_response_time": 30 # minutes |
|
|
|
|
} |
|
|
|
|
config = settings.TOURNAMENT_SETTINGS['TIME_TO_CONFIRM'] |
|
|
|
|
TIME_PROXIMITY_RULES = config['TIME_PROXIMITY_RULES'] |
|
|
|
|
WAITING_LIST_RULES = config['WAITING_LIST_RULES'] |
|
|
|
|
BUSINESS_RULES = config['BUSINESS_RULES'] |
|
|
|
|
URGENCY_OVERRIDE = config['URGENCY_OVERRIDE'] |
|
|
|
|
|
|
|
|
|
# 1. Get current time in tournament's timezone |
|
|
|
|
current_time = timezone.now() |
|
|
|
|
|