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
@@ -11,6 +11,8 @@
|
||||
use App\Models\Property;
|
||||
use App\Models\Tenant;
|
||||
use App\Process\Models\ProcessModel;
|
||||
use App\Process\Templates\FunctionTemplate;
|
||||
use App\Process\Templates\TemplateComposer;
|
||||
|
||||
/**
|
||||
* Resolves the effective process settings: built-in default → landlord default (tenant) → deviation of the property
|
||||
@@ -61,6 +63,14 @@ public function resolve(Property $property, ?Channel $channel, IntakeKind $intak
|
||||
}
|
||||
}
|
||||
|
||||
// Function templates chosen for the model's slots fix the responsibility of their area.
|
||||
foreach ($this->chosenTemplates($channel, $intake, $model) as $class) {
|
||||
foreach ($class::fixes() as $key => $fixed) {
|
||||
$values[$key] = $fixed;
|
||||
$sources[$key] = ProcessProfile::TEMPLATE;
|
||||
}
|
||||
}
|
||||
|
||||
if ($intake === IntakeKind::Internal) {
|
||||
// Own use, private stays and blocks (A6): no rental documents, no payment reminders, no guest mails – fixed by
|
||||
// the case type, not by a setting.
|
||||
@@ -80,6 +90,21 @@ public function resolve(Property $property, ?Channel $channel, IntakeKind $intak
|
||||
return new ProcessProfile($intake, ProcessProfile::caseTypeFor($intake, $channel?->isPortal() ?? false, $documents, $payments), $values, $sources);
|
||||
}
|
||||
|
||||
/**
|
||||
* The function templates in force for the chosen model's slots (chosen ones, otherwise the model's defaults).
|
||||
*
|
||||
* @return array<string, class-string<FunctionTemplate>>
|
||||
*/
|
||||
private function chosenTemplates(?Channel $channel, IntakeKind $intake, ?ProcessModel $model): array
|
||||
{
|
||||
if ($model === null || $model->slots() === []) {
|
||||
return [];
|
||||
}
|
||||
$composer = app(TemplateComposer::class);
|
||||
|
||||
return $composer->classes($composer->resolve($model, (array) (ProcessPlan::configurationOf($channel, $intake)['templates'] ?? [])));
|
||||
}
|
||||
|
||||
/**
|
||||
* The model chosen for the channel and intake kind (Kanal › Ablauf), when it is registered and fits the intake.
|
||||
*/
|
||||
|
||||
Reference in new issue
Block a user