Modellwahl über Kanalfähigkeiten mit erklärten Einschränkungen, Abgleich alter Werte, Ausführungsvarianten je Modul, getrennte Vertrags-/Buchungsinformation, Warten auf die Portalbestätigung mit Eskalation und Wiederaufnahme (Fälle C und D getestet). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
42 lines
1.3 KiB
PHP
42 lines
1.3 KiB
PHP
<?php
|
||
|
||
namespace App\Process;
|
||
|
||
/**
|
||
* One capability of a channel with the value in force and where it comes from (docs/Prozessarchitektur/V2.1/02 §3.1).
|
||
*/
|
||
final readonly class Capability
|
||
{
|
||
public const CONFIRMED = 'confirmed';
|
||
|
||
public const DERIVED = 'derived';
|
||
|
||
public const SUGGESTED = 'suggested';
|
||
|
||
public const UNKNOWN = 'unknown';
|
||
|
||
public function __construct(
|
||
public string $key,
|
||
public ?bool $value,
|
||
public string $source,
|
||
public ?string $note = null,
|
||
public ?string $confirmedAt = null,
|
||
public ?string $confirmedBy = null,
|
||
) {}
|
||
|
||
public function isKnown(): bool
|
||
{
|
||
return $this->value !== null;
|
||
}
|
||
|
||
public function sourceLabel(): string
|
||
{
|
||
return match ($this->source) {
|
||
self::CONFIRMED => 'bestätigt'.($this->confirmedBy ? ' von '.$this->confirmedBy : '').($this->confirmedAt ? ' am '.substr($this->confirmedAt, 8, 2).'.'.substr($this->confirmedAt, 5, 2).'.'.substr($this->confirmedAt, 0, 4) : ''),
|
||
self::DERIVED => 'abgeleitet aus Ihrer bisherigen Einstellung'.($this->note ? ' („'.$this->note.'“)' : '').' – bitte bestätigen oder korrigieren',
|
||
self::SUGGESTED => 'Vorschlag des Kanalprofils – bitte bestätigen',
|
||
default => 'noch nicht bekannt – bitte bestätigen',
|
||
};
|
||
}
|
||
}
|