move goal progress calculation out of the resources

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

View File

@@ -0,0 +1,22 @@
<?php
declare(strict_types=1);
namespace App\Service\Dto;
use App\Enums\GoalStatus;
use Illuminate\Support\Carbon;
readonly class GoalProgressDto
{
/**
* @param Carbon $periodStart Start of the period in UTC (inclusive)
* @param Carbon $periodEnd End of the period in UTC (exclusive)
*/
public function __construct(
public Carbon $periodStart,
public Carbon $periodEnd,
public int $trackedSeconds,
public GoalStatus $status,
) {}
}