Let a service unit use stock and machines

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This commit is contained in:
2026-11-26 16:01:59 +02:00
co-authored by Claude Sonnet 5.5
parent d160854b79
commit 361a2974cf
16 changed files with 204 additions and 13 deletions
+7 -2
View File
@@ -24,9 +24,14 @@ class FakeCatalogQueries implements CatalogQueries
$this->workTypes[$serviceUnitId][] = new WorkTypeSummary($id, $serviceUnitId, null, $name, true);
}
public function addServiceUnit(int $id, string $name, bool $active = true, bool $shared = false): void
public function addServiceUnit(int $id, string $name, bool $active = true, bool $shared = false, bool $usesStock = false): void
{
$this->serviceUnits[$id] = new ServiceUnitSummary($id, $name, $shared, $active);
$this->serviceUnits[$id] = new ServiceUnitSummary($id, $name, $shared, $active, $usesStock);
}
public function stockServiceUnitIds(): array
{
return array_values(array_keys(array_filter($this->serviceUnits, fn (ServiceUnitSummary $unit): bool => $unit->isActive && $unit->usesStock)));
}
public function tree(bool $includeInactive = true): array