V2.1: Kanalfähigkeiten, Ausführungsvarianten, Dokumentenentkopplung, Portalbestätigung

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>
This commit is contained in:
LarsandClaude Sonnet 5.5 committed 2026-11-05 07:54:11 +01:00
1 parent ef1635e59a
commit 8442d0a3d8
62 files changed
+1818 -69

No files matched your search

+35
View File
@@ -49,6 +49,41 @@ public function automatically(Booking $booking): array
return $this->send($booking, $composition, acknowledged: false, automatic: true) ? [] : ['Die Unterlagen konnten nicht versendet werden (siehe Postfach).'];
}
/**
* Creates the contract document and files it internally – without sending anything to the guest (delivery „internal“,
* docs/Prozessarchitektur/V2.1/02 §4). Same gate as the automatic dispatch: the composition must be clean.
*
* @return list<string> reasons why it was not created (empty: filed or already there)
*/
public function storeInternally(Booking $booking): array
{
if ($booking->contract_path !== null) {
return [];
}
$composition = $this->compose($booking);
if (! $composition->canSendAutomatically()) {
return [...$composition->blockers(), ...array_map(fn (string $point): string => 'Bitte prüfen: '.$point, $composition->toConfirm())];
}
$lock = Cache::lock('booking-documents-'.$booking->id, 120);
if (! $lock->get()) {
return ['Die Unterlagen werden gerade bearbeitet.'];
}
try {
$booking->refresh();
if (! $composition->termsFrozen && $composition->terms !== null) {
$booking->update(['offer_terms' => $composition->terms]);
}
return CaseLog::context(fn (): bool => $this->confirm->deliver($booking, notifyGuest: false, kind: $composition->kind), actor: CaseLog::SYSTEM.' (automatisch)')
? [] : ['Das Vertragsdokument konnte nicht erstellt werden (siehe Postfach).'];
} finally {
$lock->release();
}
}
/**
* Sending by hand after the landlord saw the composition.
*