Replace the demo home page with a dashboard

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]>
This commit is contained in:
2026-11-25 09:20:02 +02:00
co-authored by Claude Sonnet 5.5
parent d4251d00d7
commit 487a7d34ba
46 changed files with 2032 additions and 62 deletions
@@ -0,0 +1,38 @@
<?php
declare(strict_types=1);
namespace App\Modules\Dashboard\Application\Contracts;
/**
* What the management panel needs from Billing, Sales, Users and the
* holiday calendar. Days are Y-m-d.
*/
interface DashboardAdmin
{
/**
* The billing material draft being prepared, if there is one.
*/
public function openDraftId(): ?int;
/**
* Days before the day with quick sales whose cash day is not closed.
*
* @return list<string>
*/
public function unclosedCashDaysBefore(string $day): array;
/**
* Active users who do the work, subcontractors left out, by name.
*
* @return array<int, string>
*/
public function staff(): array;
/**
* Public holidays in use and company days off between the days.
*
* @return list<string>
*/
public function holidaysBetween(string $from, string $to): array;
}
@@ -0,0 +1,24 @@
<?php
declare(strict_types=1);
namespace App\Modules\Dashboard\Application\Contracts;
use App\Modules\Dashboard\Application\DTOs\PeriodFigures;
/**
* Key figures from the Reports module.
*/
interface DashboardFigures
{
/**
* Figures of the days from the first to the last (Y-m-d).
*/
public function between(string $from, string $to): PeriodFigures;
/**
* The value (VAT 0, cents) of the hours not billed yet, worked on or
* before the day.
*/
public function unbilledValueCents(string $day): int;
}
@@ -0,0 +1,26 @@
<?php
declare(strict_types=1);
namespace App\Modules\Dashboard\Application\Contracts;
use App\Modules\Dashboard\Application\DTOs\PendingApproval;
use App\Modules\Dashboard\Application\DTOs\WeekHours;
/**
* Recorded hours, from the TimeTracking module.
*/
interface DashboardTime
{
/**
* The user's hours in the week starting on the Monday (Y-m-d).
*/
public function week(int $userId, string $monday): WeekHours;
/**
* Everyone's hours waiting for approval, by person (by name).
*
* @return list<PendingApproval>
*/
public function pendingApprovals(): array;
}
@@ -0,0 +1,52 @@
<?php
declare(strict_types=1);
namespace App\Modules\Dashboard\Application\Contracts;
use App\Modules\Dashboard\Application\DTOs\WorkJob;
use App\Modules\Dashboard\Application\DTOs\WorkTask;
/**
* Jobs, tasks and their bookings, from the Jobs module. Days are Y-m-d;
* lateness is decided by the Dashboard, so isLate is false here.
*/
interface DashboardWork
{
/**
* @return list<WorkTask>
*/
public function openTasksOf(int $userId): array;
/**
* @return list<WorkJob>
*/
public function openJobsOf(int $userId): array;
/**
* @return array<string, int> Kanban status key => jobs.
*/
public function jobCountsByStatus(): array;
public function overdueJobCount(string $today): int;
public function overdueTaskCount(string $today): int;
/**
* @return list<WorkTask>
*/
public function oldestOverdueTasks(string $today, int $limit): array;
/**
* The daily maximum a person's tasks may book, in minutes.
*/
public function dailyCapacityMinutes(): int;
/**
* Minutes the open tasks book per person in the days.
*
* @param list<int> $userIds
* @return array<int, int>
*/
public function bookedMinutes(array $userIds, string $from, string $to): array;
}