Record used material on tasks and suggest workflow steps' default materials

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This commit is contained in:
2026-11-26 16:28:16 +02:00
co-authored by Claude Sonnet 5.5
parent 30132deb0e
commit bca1eed166
41 changed files with 1521 additions and 19 deletions
@@ -0,0 +1,21 @@
<?php
declare(strict_types=1);
namespace App\Modules\Inventory\Domain\Contracts;
/**
* Default materials of workflow steps waiting on the tasks made of them,
* until the assignee records or dismisses them (spec 19.4).
*/
interface TaskMaterialSuggestionRepository
{
public function add(int $taskId, int $stockItemId, int $quantityMilli): void;
/**
* @return array{id: int, taskId: int, stockItemId: int, quantityMilli: int}|null
*/
public function find(int $id): ?array;
public function remove(int $id): void;
}
@@ -0,0 +1,15 @@
<?php
declare(strict_types=1);
namespace App\Modules\Inventory\Domain\Exceptions;
use App\Modules\Shared\Domain\Exceptions\DomainException;
final class StockTaskNotAvailable extends DomainException
{
public function __construct()
{
parent::__construct('Material cannot be recorded on this task.');
}
}
@@ -0,0 +1,15 @@
<?php
declare(strict_types=1);
namespace App\Modules\Inventory\Domain\Exceptions;
use App\Modules\Shared\Domain\Exceptions\DomainException;
final class StockTaskSuggestionNotFound extends DomainException
{
public function __construct()
{
parent::__construct('The suggested material was not found.');
}
}