Everyone sees their open tasks on an agenda, their open jobs, this week's hours and quick links. Admin and management also get a lazily loaded management panel: things to do, the month so far against the previous month, jobs and late work, and everyone's workload. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
35 lines
931 B
PHP
35 lines
931 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Modules\Dashboard\Application\DTOs;
|
|
|
|
/**
|
|
* What the home page shows everyone: their open tasks on an agenda (late,
|
|
* today or tomorrow, later this week, and how many later), their first
|
|
* open jobs and how many there are, and their hours this week.
|
|
*/
|
|
final readonly class PersonalOverview
|
|
{
|
|
/**
|
|
* @param list<WorkTask> $overdue
|
|
* @param list<WorkTask> $soon
|
|
* @param list<WorkTask> $thisWeek
|
|
* @param list<WorkJob> $jobs
|
|
*/
|
|
public function __construct(
|
|
public array $overdue,
|
|
public array $soon,
|
|
public array $thisWeek,
|
|
public int $laterCount,
|
|
public array $jobs,
|
|
public int $jobCount,
|
|
public WeekHours $week,
|
|
) {}
|
|
|
|
public function hasTasks(): bool
|
|
{
|
|
return $this->overdue !== [] || $this->soon !== [] || $this->thisWeek !== [] || $this->laterCount > 0;
|
|
}
|
|
}
|