This commit is contained in:
Redsandy
2026-03-14 18:48:57 +03:00
parent 1d1350fc13
commit 3ea4fb4771
40 changed files with 2150 additions and 0 deletions

22
app/services/scoring.py Normal file
View File

@@ -0,0 +1,22 @@
"""Daily scoring engine — calculates points per user.
TODO: Implement in Phase 2 (scoring system).
"""
from sqlmodel import Session
def calculate_daily_scores(session: Session) -> int:
"""Run daily score calculation for all users.
Returns the number of users scored.
Not yet implemented — will be triggered by a cron job or manual call.
"""
# Phase 2: For each user, compute:
# - base_pts: 1 pt per 1,000 m² zone area held
# - defense bonus: +20% per defense level above 1
# - capture bonus: +50 pts per zone captured that day
# - streak bonus: x(1 + streak_days * 0.05), capped at 2x
# - activity bonus: +10 pts per km covered
return 0