move goal progress calculation out of the resources

This commit is contained in:
Gregor Vostrak
2026-10-06 18:39:35 +02:00
parent 63ca886154
commit 689b2e93e1
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