FantasyStatTracker / FantasyStatTrackerBackend

0 stars 0 forks source link

Streak API Endpint #36

Closed ajaypatel24 closed 1 year ago

ajaypatel24 commented 1 year ago

Create a new API endpoint called streak, which calculates user win or losing streak

Request api("/league/streak" methods=["GET"])

Response {     TeamName: {         Streak: signedInteger     }, }

A Positive streak indicates wins, a negative streak indicates losses Calculation if streak > 0 and current_week was a loss || streak < 0 and current_week was a win     streak = 0 if streak > 0 and current_weel was a win     streak++ if streak < 0 and current_week was a loss     streak--

Potentially store streaks in database or calculate live (live calculation is expensive)