Files
Toiminnanohjaus/app/Modules/Catalog/Domain/ValueObjects/WorkflowStep.php
T

29 lines
795 B
PHP

<?php
declare(strict_types=1);
namespace App\Modules\Catalog\Domain\ValueObjects;
/**
* One step of a workflow template. A task is made of it: the title, the
* description and the work type, which is the template's own when
* $workTypeId is null, and the default materials suggested on the task.
*/
final readonly class WorkflowStep
{
public ?string $description;
/**
* @param list<WorkflowStepMaterial> $materials
*/
public function __construct(
public WorkflowStepTitle $title,
?string $description = null,
public ?int $workTypeId = null,
public array $materials = [],
) {
$description = $description === null ? '' : trim($description);
$this->description = $description === '' ? null : $description;
}
}