Kanalkonfigurator und Prozess-Tester auf Schablonenbasis

Geschäftsentscheidungen zuerst (Schablonen je Bereich, Voreinstellungen A3–A5), Einzelschritte
eingeklappt, Auswirkungsanalyse beim Schablonenwechsel, unbestätigte Portal-Fähigkeiten gekennzeichnet.
Tester-Bericht nennt Schablonen, unabhängig laufende Schritte und fehlende Nachweise; alle vier
Kombinationen sind als Szenario getestet. Doku: SCHABLONEN.md.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
LarsandClaude Sonnet 5.5 committed 2026-11-05 10:56:51 +01:00
1 parent e95ba4f986
commit c46f4a032b
12 files changed
+810 -10

No files matched your search

@@ -11,6 +11,7 @@
use App\Enums\ProcessSetting;
use App\Enums\Responsibility;
use App\Models\Channel;
use App\Process\Models\ExternalBookingModel;
use App\Process\Models\ProcessModel;
use App\Process\Models\Responsibilities;
use App\Process\Templates\FunctionTemplate;
@@ -181,6 +182,24 @@ public function templateOptions(Channel $channel, ProcessModel $model, ?array $c
return $options;
}
/**
* The templates in force for new cases of the channel and intake kind (key@version per area): the saved choice of a
* model with slots, otherwise the combination a legacy archetype reproduces (empty when there is none).
*
* @return array<string, string>
*/
public function currentTemplates(Channel $channel, IntakeKind $intake): array
{
$current = $this->current($channel, $intake);
$model = $this->catalogue->model($current['model']);
if ($model->slots() !== []) {
return $this->composer->resolve($model, $current['templates']);
}
return $model::presetTemplates() === [] ? [] : $this->composer->resolve($this->catalogue->model(ExternalBookingModel::key()), $model::presetTemplates());
}
/**
* The templates a draft uses for the model slots (chosen ones, otherwise the model defaults) as key@version.
*
@@ -239,6 +258,14 @@ public function conflicts(Channel $channel, IntakeKind $intake, string $modelKey
'text' => $setting->question().' Bisher eingestellt: „'.$setting->describe($value).'“. Das Modell „'.$modelKey.'“ erlaubt: „'.$allowed.'“.'];
}
// A model with slots does not narrow the guest communication itself: the portal's capability does.
$messages = $model->slots() === [] ? null : (app(ChannelCapabilities::class)->resolve($channel)[ChannelCapabilities::MESSAGES_GUEST] ?? null);
$storedMessages = ProcessSetting::GuestMessages->normalize($stored[ProcessSetting::GuestMessages->value] ?? null);
if ($messages !== null && $messages->isKnown() && $messages->value === false && $storedMessages === Responsibility::Portal->value) {
$conflicts[] = ['setting' => ProcessSetting::GuestMessages, 'stored' => ProcessSetting::GuestMessages->describe($storedMessages), 'fixed' => ProcessSetting::GuestMessages->describe(Responsibility::Landlord->value),
'text' => ProcessSetting::GuestMessages->question().' Bisher eingestellt: „'.ProcessSetting::GuestMessages->describe($storedMessages).'“. Laut Fähigkeit des Portals schreibt es den Gast aber nicht an; künftig: „'.ProcessSetting::GuestMessages->describe(Responsibility::Landlord->value).'“.'];
}
return $conflicts;
}