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
@@ -48,6 +48,16 @@ public static function responsibilities(): Responsibilities
|
||||
);
|
||||
}
|
||||
|
||||
public static function isLegacy(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public static function presetTemplates(): array
|
||||
{
|
||||
return ['collection' => 'collection.own', 'contract_documents' => 'contract_docs.own'];
|
||||
}
|
||||
|
||||
public static function fixes(): array
|
||||
{
|
||||
return ['payments' => 'landlord', 'documents' => 'landlord'];
|
||||
|
||||
@@ -48,6 +48,16 @@ public static function responsibilities(): Responsibilities
|
||||
);
|
||||
}
|
||||
|
||||
public static function isLegacy(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public static function presetTemplates(): array
|
||||
{
|
||||
return ['collection' => 'collection.portal', 'contract_documents' => 'contract_docs.own'];
|
||||
}
|
||||
|
||||
public static function fixes(): array
|
||||
{
|
||||
return ['payments' => 'portal', 'documents' => 'landlord'];
|
||||
|
||||
@@ -48,6 +48,16 @@ public static function responsibilities(): Responsibilities
|
||||
);
|
||||
}
|
||||
|
||||
public static function isLegacy(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public static function presetTemplates(): array
|
||||
{
|
||||
return ['collection' => 'collection.portal', 'contract_documents' => 'contract_docs.external'];
|
||||
}
|
||||
|
||||
public static function fixes(): array
|
||||
{
|
||||
return ['payments' => 'portal', 'documents' => 'portal'];
|
||||
|
||||
@@ -0,0 +1,107 @@
|
||||
<?php
|
||||
|
||||
namespace App\Process\Models;
|
||||
|
||||
use App\Enums\CaseType;
|
||||
use App\Enums\IntakeKind;
|
||||
use App\Enums\Responsibility;
|
||||
use App\Process\Templates\TemplateArea;
|
||||
|
||||
/**
|
||||
* The base process of a booking that is already binding at a portal (E-036), with slots for the function templates
|
||||
* of collection and contract documentation. It replaces the fixed combinations A3/A4/A5: who collects and who provides
|
||||
* the contract documents are chosen independently (docs/Prozessarchitektur/SCHABLONEN.md); the case type stays a derived
|
||||
* classification. The course is the one A3–A5 share, with the slots at the positions of the modules they replace.
|
||||
*/
|
||||
class ExternalBookingModel extends ProcessModel
|
||||
{
|
||||
/** Results the base process provides to the templates. */
|
||||
public const PROVIDES = ['case.recorded', 'guest.identified', 'binding.portal_total'];
|
||||
|
||||
public static function key(): string
|
||||
{
|
||||
return 'external.booking';
|
||||
}
|
||||
|
||||
public static function version(): int
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
public static function label(): string
|
||||
{
|
||||
return 'Extern verbindliche Portalbuchung';
|
||||
}
|
||||
|
||||
public static function description(): string
|
||||
{
|
||||
return 'Das Portal bestätigt verbindlich. Wer das Geld einzieht und wer die Vertragsunterlagen bereitstellt, wählen Sie unabhängig voneinander; die Einzelschritte bleiben einstellbar.';
|
||||
}
|
||||
|
||||
public static function caseTypes(): array
|
||||
{
|
||||
return [CaseType::A3, CaseType::A4, CaseType::A5];
|
||||
}
|
||||
|
||||
public static function intakes(): array
|
||||
{
|
||||
return [IntakeKind::Booking];
|
||||
}
|
||||
|
||||
/**
|
||||
* Collection and contract documentation are chosen by template; guest communication is limited by the portal's
|
||||
* confirmed capability, not by a fixed model.
|
||||
*/
|
||||
public static function responsibilities(): Responsibilities
|
||||
{
|
||||
return Responsibilities::of(
|
||||
fixed: ['contract' => Responsibility::Portal],
|
||||
variable: [
|
||||
'collection' => [Responsibility::Landlord, Responsibility::Portal],
|
||||
'contract_documents' => [Responsibility::Landlord, Responsibility::Portal],
|
||||
'guest_messages' => [Responsibility::Landlord, Responsibility::Portal],
|
||||
'supplementary_documents' => [Responsibility::Landlord, Responsibility::Nobody],
|
||||
'local_services' => [Responsibility::Landlord],
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
public static function providedResults(): array
|
||||
{
|
||||
return self::PROVIDES;
|
||||
}
|
||||
|
||||
public static function defaultTemplates(): array
|
||||
{
|
||||
return [
|
||||
TemplateArea::Collection->value => 'collection.own',
|
||||
TemplateArea::ContractDocuments->value => 'contract_docs.own',
|
||||
];
|
||||
}
|
||||
|
||||
public function steps(): array
|
||||
{
|
||||
return [
|
||||
Step::module('intake.record'),
|
||||
Step::module('guest.details'),
|
||||
Step::point(Point::AfterGuestIdentified),
|
||||
Step::module('binding.portal'),
|
||||
Step::module('portal.confirmation'),
|
||||
Step::point(Point::AfterBinding),
|
||||
Step::slot(TemplateArea::ContractDocuments),
|
||||
Step::module('channels.block'),
|
||||
Step::slot(TemplateArea::Collection),
|
||||
Step::module('case.tasks'),
|
||||
Step::module('change.proposal'),
|
||||
Step::module('arrival.details'),
|
||||
Step::module('arrival.info'),
|
||||
Step::module('guest.data_request'),
|
||||
Step::point(Point::BeforeStay),
|
||||
Step::module('stay'),
|
||||
Step::module('review.request'),
|
||||
Step::point(Point::BeforeSettlement),
|
||||
Step::module('case.closure'),
|
||||
Step::module('case.settlement'),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -2,12 +2,15 @@
|
||||
|
||||
namespace App\Process\Models;
|
||||
|
||||
use App\Process\Templates\TemplateArea;
|
||||
|
||||
/**
|
||||
* One entry of a model's course: a module or an extension point where variants insert modules.
|
||||
* One entry of a model's course: a module, an extension point where variants insert modules, or a slot where the
|
||||
* function template chosen for its area puts its modules.
|
||||
*/
|
||||
final readonly class Step
|
||||
{
|
||||
private function __construct(public ?string $module, public ?Point $point) {}
|
||||
private function __construct(public ?string $module, public ?Point $point, public ?TemplateArea $slot = null) {}
|
||||
|
||||
public static function module(string $key): self
|
||||
{
|
||||
@@ -19,8 +22,18 @@ public static function point(Point $point): self
|
||||
return new self(null, $point);
|
||||
}
|
||||
|
||||
public static function slot(TemplateArea $area): self
|
||||
{
|
||||
return new self(null, null, $area);
|
||||
}
|
||||
|
||||
public function isPoint(): bool
|
||||
{
|
||||
return $this->point !== null;
|
||||
}
|
||||
|
||||
public function isSlot(): bool
|
||||
{
|
||||
return $this->slot !== null;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user