Dokumentenzusammenstellung und Vorlagensteuerung (Paket 3, Prozessarchitektur v0.10)
Deploy FeWo mit PipelineManager / deploy (push) Successful in 3m59s

Eine Zusammenstellung vor jedem Dokument (Angebot, Bestaetigung, Buchungsunterlagen
extern), Dokumentart je Vorgangsart, Freigaben fuer Vorlagen und Dokumentarten,
Schutz vor unvereinbarten Bedingungen bei Portalbuchungen (E-004), kein doppelter
Versand, Absicherung Hold 0 bis Paket 7, A6-Aufenthaltsbestaetigung vorbereitet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
LarsandClaude Opus 5.5 committed 2026-11-01 19:44:52 +01:00
1 parent 64248c09fa
commit cf11c8a474
45 files changed
+2385 -144

No files matched your search

+16 -10
View File
@@ -8,8 +8,8 @@
use App\Exceptions\ReservationException;
use App\Models\Booking;
use App\Models\Guest;
use App\Process\CaseAutomation;
use Illuminate\Support\Arr;
use Illuminate\Support\Facades\DB;
/**
* The guest's contact data arrived (portal message, e-mail, phone) and is entered on the booking. The landlord chooses
@@ -22,7 +22,7 @@ class ProvideGuestContact
public const MANUAL = 'manual';
public function __construct(private ConfirmBooking $confirm, private SendOffer $offer) {}
public function __construct(private ConfirmBooking $confirm, private AutoOffer $autoOffer, private SendBookingDocuments $documents) {}
/**
* @param array<string, ?string> $contact first_name, last_name, email, phone, street, postal_code, city, country
@@ -62,22 +62,28 @@ public function handle(Booking $booking, array $contact, string $process = self:
$booking->update(['processing_mode' => ProcessingMode::Automatic]);
if (in_array($booking->status, BookingStatus::occupying(), true)) {
$missing = app(CaseAutomation::class)->documentBlockers($booking);
if ($missing !== []) {
throw new ReservationException('Kontaktdaten gespeichert. Die Unterlagen können noch nicht automatisch versendet werden: '.implode(' ', $missing));
$reasons = $this->documents->automatically($booking);
if ($reasons !== []) {
throw new ReservationException('Kontaktdaten gespeichert. Die Unterlagen werden noch nicht automatisch versendet: '.implode(' ', $reasons));
}
$this->confirm->deliver($booking);
return 'Kontaktdaten gespeichert, Vertrag gesendet';
return 'Kontaktdaten gespeichert, Unterlagen gesendet';
}
if ($booking->intake === IntakeKind::Booking) {
$this->confirm->handle($booking);
DB::transaction(fn () => $this->confirm->bind($booking));
$reasons = $this->documents->automatically($booking->fresh());
if ($reasons !== []) {
throw new ReservationException('Kontaktdaten gespeichert und Buchung bestätigt. Die Unterlagen werden noch nicht automatisch versendet: '.implode(' ', $reasons));
}
return 'Kontaktdaten gespeichert, Buchung bestätigt und Vertrag gesendet';
return 'Kontaktdaten gespeichert, Buchung bestätigt und Unterlagen gesendet';
}
$this->offer->handle($booking);
$reasons = $this->autoOffer->handle($booking);
if ($reasons !== []) {
throw new ReservationException('Kontaktdaten gespeichert. Das Angebot wird noch nicht automatisch gesendet: '.implode(' ', $reasons));
}
return 'Kontaktdaten gespeichert, Angebot gesendet';
}