File size: 464 Bytes
d64fd55
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
from typing import Optional, Dict, Any
import uuid

class GoalProgressService:
    """
    Service to compute goal progress statistics.
    """

    def compute(self, goal_service, goal, weekly_snapshot, period_comparison=None) -> Optional[Dict[str, Any]]:
        """
        Computes goal progress for a runner.
        """
        if not goal:
            return None

        return goal_service.compute_goal_progress(goal, weekly_snapshot, period_comparison)