Schablonenkomposition: Basisprozess external.booking mit Platz für Finanz- und Dokumentenschablonen
Vier Schablonen (Eigenes/Portal-Inkasso, Eigene/Externe Vertragsdokumentation) in app/Process/Templates, TemplateComposer prüft Ergebnisse, Verantwortlichkeiten, Ausschlüsse und harte Modulabhängigkeiten. Der Plan friert die Schablonenversionen ein. A3–A5 bleiben als Voreinstellungen; die vierte Kombination (eigenes Inkasso + externe Unterlagen) ist darstellbar. Konfigurator-Logik und ConfigureChannelProcess kennen die Schablonenwahl. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
381720763c
commit
e95ba4f986
24 files changed
+1666
-37
No files matched your search
@@ -5,6 +5,8 @@
|
||||
use App\Enums\CaseType;
|
||||
use App\Enums\IntakeKind;
|
||||
use App\Enums\ProcessSetting;
|
||||
use App\Process\ProcessCatalogue;
|
||||
use App\Process\Templates\TemplateArea;
|
||||
|
||||
/**
|
||||
* A centrally defined, versioned process model (docs/Prozessarchitektur/Architektur/02 §5): its course of steps with
|
||||
@@ -74,17 +76,74 @@ public function variant(string $key): ?Variant
|
||||
}
|
||||
|
||||
/**
|
||||
* The modules of the course in order, with the variant's modules at their points.
|
||||
* The function template areas this model offers a slot for (empty: the model's course is fixed).
|
||||
*
|
||||
* @return list<TemplateArea>
|
||||
*/
|
||||
public function slots(): array
|
||||
{
|
||||
return array_values(array_map(fn (Step $step): TemplateArea => $step->slot, array_filter($this->steps(), fn (Step $step): bool => $step->isSlot())));
|
||||
}
|
||||
|
||||
/**
|
||||
* The results the base course provides to the templates of its slots (see FunctionTemplate::requires()).
|
||||
*
|
||||
* @return list<string>
|
||||
*/
|
||||
public function modules(?string $variant = 'standard'): array
|
||||
public static function providedResults(): array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
/**
|
||||
* The template (key) every slot gets when none was chosen: area value => template key.
|
||||
*
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public static function defaultTemplates(): array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the model is kept for compatibility (existing channels and frozen plans) and no longer offered as a
|
||||
* choice: its combination is a preset of a composable model.
|
||||
*/
|
||||
public static function isLegacy(): bool
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* The template combination that reproduces this legacy model (area value => template key), or empty.
|
||||
*
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public static function presetTemplates(): array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
/**
|
||||
* The modules of the course in order, with the variant's modules at their points and the chosen templates' modules
|
||||
* at their slots.
|
||||
*
|
||||
* @param array<string, string> $templates area value => template key or key@version (missing areas: the default)
|
||||
* @return list<string>
|
||||
*/
|
||||
public function modules(?string $variant = 'standard', array $templates = []): array
|
||||
{
|
||||
$chosen = $this->variant($variant ?? 'standard');
|
||||
$catalogue = app(ProcessCatalogue::class);
|
||||
$modules = [];
|
||||
foreach ($this->steps() as $step) {
|
||||
if ($step->isPoint()) {
|
||||
array_push($modules, ...($chosen?->modulesAt($step->point) ?? []));
|
||||
} elseif ($step->isSlot()) {
|
||||
$reference = $templates[$step->slot->value] ?? static::defaultTemplates()[$step->slot->value] ?? null;
|
||||
if ($reference !== null && ($class = $catalogue->templateClass($reference)) !== null) {
|
||||
array_push($modules, ...$class::modules());
|
||||
}
|
||||
} else {
|
||||
$modules[] = $step->module;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user