Pakete 7 und 9: Auskunft und Buchungswunsch, Aufenthalt und Abschluss (Zwischenstand)

- Haltefrist 0: unverbindliche Auskunft mit signiertem Link "Buchung anfragen",
  erneute Prüfung unter Sperre, automatische oder manuelle Bestätigung, Absage
  bei vergebenem Zeitraum, Ablauf unbeantworteter Auskünfte
- Aufenthalt: Anreisedaten, Aufgaben je Wohnung, gebuchte Leistungen,
  Abweichungen und Folgeaufgaben als Aufgaben am Vorgang
- Abschluss getrennt: Aufenthalt abgeschlossen / kaufmännisch abgeschlossen,
  Nachläufer (Forderung, Auszahlung) bleiben sichtbar
- Zahlungsstatus nur aus Geld auf unserem Konto; Altbestand per Vorschau-Befehl
- Verlauf weist Testzustellungen als solche aus
- Abnahmetests T16-T25, T23 über isolierten SMTP-Empfänger

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
LarsandClaude Opus 5.5 committed 2026-11-02 08:29:19 +01:00
1 parent 3bcfc09417
commit 40d20cb7d1
52 files changed
+3196 -89

No files matched your search

+23 -4
View File
@@ -5,6 +5,8 @@
use App\Enums\BookingStatus;
use App\Models\Booking;
use App\Models\Guest;
use App\Models\Tenant;
use App\Support\Settings;
/**
* Model hooks of a case: freezes the process profile when the case comes in (and again when what defines it – intake
@@ -53,6 +55,10 @@ public static function updated(Booking $booking): void
CaseLog::record($booking, 'guest', 'Gast zugeordnet: '.(Guest::query()->find($booking->guest_id)?->full_name ?? '–'));
}
if (array_key_exists('information_version', $changes) && $booking->information_version > 0) {
CaseLog::record($booking, 'information', 'Unverbindliche Auskunft Version '.$booking->information_version.' gesendet'.($booking->information_valid_until ? ', Buchung anfragen bis '.$booking->information_valid_until->format('d.m.Y, H:i').' Uhr' : '').' – ohne Reservierung');
}
if (array_key_exists('offer_version', $changes) && $booking->offer_version > 0) {
CaseLog::record($booking, 'offer', 'Angebot Version '.$booking->offer_version.' gesendet'.($booking->hold_expires_at ? ', gültig bis '.$booking->hold_expires_at->format('d.m.Y, H:i').' Uhr' : ''));
} elseif (array_key_exists('hold_expires_at', $changes) && $booking->hold_expires_at !== null && in_array($booking->status, BookingStatus::holding(), true) && ! array_key_exists('status', $changes)) {
@@ -78,9 +84,10 @@ public static function updated(Booking $booking): void
'arrival_info_sent_at' => 'Anreise-Informationen gesendet',
'review_requested_at' => 'Gast um eine Bewertung gebeten',
];
$mailed = ['contact_requested_at', 'confirmation_sent_at', 'arrival_info_sent_at', 'review_requested_at'];
foreach ($facts as $column => $summary) {
if (array_key_exists($column, $changes) && $booking->{$column} !== null) {
CaseLog::record($booking, 'fact', $summary);
CaseLog::record($booking, 'fact', in_array($column, $mailed, true) ? self::mailFact($booking, $summary) : $summary);
}
}
@@ -93,17 +100,29 @@ public static function updated(Booking $booking): void
}
}
/**
* A fact that says a mail went to the guest – in test operation it went to the test address only, and the history says so.
*/
private static function mailFact(Booking $booking, string $summary): string
{
$redirect = Settings::mailRedirectFor(Tenant::query()->find($booking->tenant_id));
return $redirect === null ? $summary : $summary.' – Testbetrieb: nur an die Testadresse, nicht an den Gast';
}
private static function statusSummary(Booking $booking, mixed $from): string
{
$from = $from instanceof BookingStatus ? $from : BookingStatus::tryFrom((string) $from);
return match ($booking->status) {
BookingStatus::Confirmed => $booking->wasChanged('accepted_at') && $booking->accepted_at !== null
BookingStatus::Confirmed => ($booking->acceptance['via'] ?? null) === 'booking_wish' && $booking->wasChanged('acceptance')
? 'Buchungswunsch bestätigt – Buchung verbindlich'
: ($booking->wasChanged('accepted_at') && $booking->accepted_at !== null
? 'Angebot vom Gast angenommen – Buchung verbindlich'
: ($booking->caseType()->isExternallyBinding() ? 'Beim Portal verbindlich gebucht – übernommen' : 'Buchung verbindlich bestätigt'),
: ($booking->caseType()->isExternallyBinding() ? 'Beim Portal verbindlich gebucht – übernommen' : 'Buchung verbindlich bestätigt')),
BookingStatus::DepositPaid => 'Anzahlung eingegangen',
BookingStatus::Paid => 'Vollständig bezahlt',
BookingStatus::Completed => 'Aufenthalt abgeschlossen',
BookingStatus::Completed => 'Aufenthalt abgeschlossen'.($booking->settled_at === null ? ' – kaufmännische Punkte laufen weiter' : ''),
BookingStatus::Declined => 'Ohne Buchung beendet (abgelehnt'.($booking->declined_by ? ' durch '.($booking->declined_by === 'guest' ? 'den Gast' : 'uns') : '').')',
BookingStatus::Expired => 'Ohne Buchung beendet (Frist abgelaufen)',
BookingStatus::Cancelled => 'Storniert',