Vorgangskern und geführte Vorgangsbearbeitung (Pakete 1 und 2, Prozessarchitektur v0.10)
- Buchung ist der einheitliche Vorgang: Eingangsart, Vorgangsart A1–A6, eingefrorenes Abwicklungsprofil, gespeicherter Verlauf (booking_events); Gast, Personen und Beträge dürfen unbekannt sein, Platzhalter-Gäste werden migriert und nicht mehr angelegt - Einstellungen in Ebenen: Vermieterstandard (So arbeite ich), Abweichung der Wohnung (Experte), Abweichung je Portal und Eingangsart; ersetzt booking_model als Steuergröße - Ein Weg für extern verbindliche Buchungen (TakeOverExternalBooking) statt RecordPortalBooking und "Akte anlegen"; Portalpreis als belegte Gesamtposition - Startseite "Zu erledigen", neue Vorgangsseite mit nächstem Schritt, Automatik-Schalter, "Beenden" mit Storno statt Statusumschaltung; Status von Hand nur im Expertenmodus - Migration übernimmt bisheriges Verhalten unverändert (abweichende Wohnungswerte bleiben als Abweichung), Bericht: php artisan process:settings-report Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
9005c12164
commit
3a728c3255
78 files changed
+4296
-1180
No files matched your search
@@ -9,6 +9,7 @@
|
||||
use App\Exceptions\ReservationException;
|
||||
use App\Models\Booking;
|
||||
use App\Models\BookingTask;
|
||||
use App\Process\CaseLog;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
/**
|
||||
@@ -33,6 +34,10 @@ public function handle(Booking $booking, BookingStatus $status, string $reason,
|
||||
throw new ReservationException('Auf diesen Status kann nicht von Hand gewechselt werden. Stornieren und Ablehnen haben eigene Aktionen.');
|
||||
}
|
||||
|
||||
if ($status === BookingStatus::Reserved && in_array($booking->status, BookingStatus::occupying(), true)) {
|
||||
throw new ReservationException('Eine verbindliche Buchung kann nicht wieder zur Anfrage gemacht werden. Soll sie enden, bitte „Beenden“ wählen – dann wird sie ordentlich storniert.');
|
||||
}
|
||||
|
||||
if (blank(trim($reason))) {
|
||||
throw new ReservationException('Bitte einen Grund für die Statusänderung angeben.');
|
||||
}
|
||||
@@ -44,6 +49,9 @@ public function handle(Booking $booking, BookingStatus $status, string $reason,
|
||||
if ($from === $status) {
|
||||
throw new ReservationException('Die Buchung hat diesen Status bereits.');
|
||||
}
|
||||
if ($status === BookingStatus::Reserved && in_array($from, BookingStatus::occupying(), true)) {
|
||||
throw new ReservationException('Eine verbindliche Buchung kann nicht wieder zur Anfrage gemacht werden.');
|
||||
}
|
||||
|
||||
$becomesBinding = in_array($status, BookingStatus::occupying(), true) && ! in_array($from, BookingStatus::occupying(), true);
|
||||
if ($becomesBinding && ! $this->availability->isAvailable($booking->property, $booking->arrival, $booking->departure, ignore: $booking)) {
|
||||
@@ -59,7 +67,7 @@ public function handle(Booking $booking, BookingStatus $status, string $reason,
|
||||
}
|
||||
|
||||
$line = now()->format('d.m.Y H:i').' '.$by.': Status von „'.$from->getLabel().'“ auf „'.$status->getLabel().'“ gesetzt – '.trim($reason);
|
||||
$booking->update($changes + ['internal_notes' => trim(($booking->internal_notes ? $booking->internal_notes."\n" : '').$line)]);
|
||||
CaseLog::context(fn () => $booking->update($changes + ['internal_notes' => trim(($booking->internal_notes ? $booking->internal_notes."\n" : '').$line)]), actor: $by, reason: 'Von Hand gesetzt: '.trim($reason));
|
||||
|
||||
// A booking taken back into the process no longer needs the cancellation follow-up.
|
||||
if ($becomesBinding) {
|
||||
|
||||
Reference in new issue
Block a user