move goal progress calculation out of the resources

This commit is contained in:
Gregor Vostrak
2026-10-06 18:39:35 +02:00
parent f9519d0d5a
commit 3a7a354551
7 changed files with 149 additions and 26 deletions

View File

@@ -43,9 +43,8 @@ class GoalProgressServiceTest extends TestCase
private function progressAt(Goal $goal, Carbon $now): int
{
Carbon::setTestNow($now);
[$periodStart, $periodEnd] = $this->service->getPeriodBounds($goal, $now);
return $this->service->getProgress($goal, $periodStart, $periodEnd);
return $this->service->getCurrentProgress($goal, $now)->trackedSeconds;
}
public function test_period_bounds_of_day_goal_are_calculated_in_the_timezone_of_the_goal(): void