Track machine counters and maintenance with counter and time intervals

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This commit is contained in:
2026-11-26 16:52:49 +02:00
co-authored by Claude Sonnet 5.5
parent aac579257a
commit 3e1c671949
53 changed files with 2636 additions and 6 deletions
@@ -0,0 +1,16 @@
<?php
declare(strict_types=1);
namespace App\Modules\Machines\Application\Contracts;
/**
* Records the stock used at a maintenance through the Inventory module.
*/
interface MaintenanceMaterials
{
/**
* @return bool False when the stock could not be recorded (e.g. the item is out of use).
*/
public function use(int $stockItemId, int $quantityMilli, int $machineId, int $maintenanceRecordId, int $userId): bool;
}
@@ -0,0 +1,36 @@
<?php
declare(strict_types=1);
namespace App\Modules\Machines\Application\Contracts;
use App\Modules\Machines\Application\DTOs\MaintenanceItemStatus;
use App\Modules\Machines\Application\DTOs\MaintenanceRecordSummary;
interface MaintenanceQueries
{
/**
* A machine's maintenance items with their states, late ones first.
*
* @return list<MaintenanceItemStatus>
*/
public function itemsOf(int $machineId, bool $includeInactive = false): array;
public function findItem(int $itemId): ?MaintenanceItemStatus;
/**
* Items in use of machines in use whose maintenance is coming up or
* late: the maintenance requests.
*
* @return list<MaintenanceItemStatus>
*/
public function due(): array;
/**
* A machine's maintenance history, newest first, filtered by item and
* by days (Y-m-d, both inclusive).
*
* @return list<MaintenanceRecordSummary>
*/
public function history(int $machineId, ?int $itemId = null, ?string $from = null, ?string $to = null, int $limit = 200): array;
}