← Code-Übersicht

Schritt.php

Pfad: src/Domain/Prozess/Schritt.php

Ext: php

Größe: 1479 Bytes

Geändert: 2026-07-15 23:53:28+02

<?php
declare(strict_types=1);

namespace Demo\Domain\Prozess;

/**
 * Ein Prozess-Schritt (atomar oder Aufruf eines Teilprozesses). Unveraenderlich.
 */
final class Schritt
{
    /**
     * @param int                   $id           Schluessel.
     * @param string                $name         Kurzname.
     * @param string                $beschreibung Markdown-Beschreibung.
     * @param string                $akteur       Handelnder Akteur.
     * @param string                $system       Ausfuehrendes System.
     * @param string|null           $rolle        Fachliche Rolle, optional.
     * @param string|null           $ruftSlug     Slug des aufgerufenen Teilprozesses.
     * @param string|null           $ruftTitel    Titel des aufgerufenen Teilprozesses.
     * @param list<SchrittArtefakt> $artefakte    Zugeordnete Artefakte.
     */
    public function __construct(
        public readonly int $id,
        public readonly string $name,
        public readonly string $beschreibung,
        public readonly string $akteur,
        public readonly string $system,
        public readonly ?string $rolle,
        public readonly ?string $ruftSlug,
        public readonly ?string $ruftTitel,
        public readonly array $artefakte
    ) {
    }

    /**
     * Ob dieser Schritt einen Teilprozess aufruft.
     *
     * @return bool True bei Aufruf-Schritt.
     */
    public function istAufruf(): bool
    {
        return $this->ruftSlug !== null;
    }
}