Track machine counters and maintenance with counter and time intervals
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This commit is contained in:
@@ -5,8 +5,8 @@ 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.
|
||||
* What the management panel needs from Billing, Sales, Users, Machines,
|
||||
* Inventory and the holiday calendar. Days are Y-m-d.
|
||||
*/
|
||||
interface DashboardAdmin
|
||||
{
|
||||
@@ -35,4 +35,16 @@ interface DashboardAdmin
|
||||
* @return list<string>
|
||||
*/
|
||||
public function holidaysBetween(string $from, string $to): array;
|
||||
|
||||
/**
|
||||
* Machine maintenance that is late (maintenance requests), by machine.
|
||||
*
|
||||
* @return list<array{machineId: int, machine: string, item: string}>
|
||||
*/
|
||||
public function lateMaintenance(): array;
|
||||
|
||||
/**
|
||||
* How many stock items are at or below their reorder level.
|
||||
*/
|
||||
public function stockItemsToOrder(): int;
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ final readonly class ManagementOverview
|
||||
* @param array<string, int> $jobCounts
|
||||
* @param list<WorkTask> $oldestOverdueTasks
|
||||
* @param list<PersonLoad> $workloads
|
||||
* @param list<array{machineId: int, machine: string, item: string}> $lateMaintenance
|
||||
*/
|
||||
public function __construct(
|
||||
public array $pendingApprovals,
|
||||
@@ -42,5 +43,7 @@ final readonly class ManagementOverview
|
||||
public string $thisMonday,
|
||||
public string $nextMonday,
|
||||
public array $workloads,
|
||||
public array $lateMaintenance = [],
|
||||
public int $stockItemsToOrder = 0,
|
||||
) {}
|
||||
}
|
||||
|
||||
@@ -62,6 +62,8 @@ final readonly class ManagementOverviewQuery
|
||||
$thisMonday->format('Y-m-d'),
|
||||
$nextMonday->format('Y-m-d'),
|
||||
$this->workloads($thisMonday, $nextMonday),
|
||||
$this->admin->lateMaintenance(),
|
||||
$this->admin->stockItemsToOrder(),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user