Add Reports module with the hours by person report

Management's reports (spec 13) get their own module that reads the other
modules through ports. The first report sums hours by person in a period,
narrowed by service unit or customer, with breakdowns, a chart and CSV.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This commit is contained in:
2026-11-25 08:39:19 +02:00
co-authored by Claude Sonnet 5.5
parent f906f9a43f
commit 64f1e7c54a
45 changed files with 1828 additions and 3 deletions
@@ -0,0 +1,27 @@
<?php
declare(strict_types=1);
namespace App\Modules\Reports\Application\Contracts;
use App\Modules\Reports\Application\DTOs\ReportWorkType;
/**
* Service units, work types and their prices, from the Catalog module.
*/
interface ReportCatalog
{
/**
* Every work type, inactive ones included.
*
* @return array<int, ReportWorkType>
*/
public function workTypes(): array;
/**
* Every service unit's name in catalog order, inactive ones included.
*
* @return array<int, string>
*/
public function serviceUnits(): array;
}
@@ -0,0 +1,29 @@
<?php
declare(strict_types=1);
namespace App\Modules\Reports\Application\Contracts;
use App\Modules\Reports\Application\DTOs\HoursEntry;
use App\Modules\Reports\Application\DTOs\UnbilledEntry;
use App\Modules\Reports\Domain\ValueObjects\ReportPeriod;
/**
* Recorded hours, from the TimeTracking module.
*/
interface ReportHours
{
/**
* Hours worked in the period by user, job and work type.
*
* @return list<HoursEntry>
*/
public function between(ReportPeriod $period): array;
/**
* Unbilled hours worked on or before the day (Y-m-d) by job and work type.
*
* @return list<UnbilledEntry>
*/
public function unbilledUntil(string $day): array;
}
@@ -0,0 +1,19 @@
<?php
declare(strict_types=1);
namespace App\Modules\Reports\Application\Contracts;
use App\Modules\Reports\Application\DTOs\ReportJob;
/**
* Customer jobs, from the Jobs and Customers modules.
*/
interface ReportJobs
{
/**
* @param list<int> $ids
* @return array<int, ReportJob> Keyed by id; unknown ids are left out.
*/
public function infoOf(array $ids): array;
}
@@ -0,0 +1,17 @@
<?php
declare(strict_types=1);
namespace App\Modules\Reports\Application\Contracts;
/**
* Users' names, from the Users module.
*/
interface ReportPeople
{
/**
* @param list<int> $ids
* @return array<int, string>
*/
public function namesByIds(array $ids): array;
}