Skip to content

Commit

Permalink
fix(backend): provide total billable time in task meta
Browse files Browse the repository at this point in the history
  • Loading branch information
c0rydoras committed Jan 31, 2025
1 parent 76b2bb7 commit cbc27b8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions backend/timed/projects/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,9 @@ def get_root_meta(self, _resource, many):
queryset = Report.objects.filter(task=self.instance)
data = queryset.aggregate(spent_time=Sum("duration"))
data["spent_time"] = duration_string(data["spent_time"] or timedelta(0))
billable_data = queryset.filter(not_billable=False, review=False).aggregate(spent_billable=Sum("duration"))
data["spent_billable"] = duration_string(billable_data["spent_billable"] or timedelta(0))

return data

return {}
Expand Down

0 comments on commit cbc27b8

Please sign in to comment.