Buchungsprozess: Angebots-Snapshot, atomare Annahme, Auto-Angebot, Kanalfreigabe
Deploy FeWo mit PipelineManager / deploy (push) Failing after 3m38s
Deploy FeWo mit PipelineManager / deploy (push) Failing after 3m38s
- Angebotsbedingungen und Zahlungsdaten werden je Version eingefroren (offer_terms, offer_hash) - Annahme in einer gesperrten Transaktion, idempotent, mit Nachweis; Mail- und Portalfehler machen eine gespeicherte Buchung nicht ungueltig (Postfach, Nachversand) - Je Wohnung: manuelle/automatische Angebote, optionale Vorreservierung - Automatische Freigabe abhaengig von aktuellen Importen und Feed-Abruf bei Sofortbuchungsportalen - Deutsche Fehlerseiten, Buchungsseite zeigt Angebots- und Zustellstatus - Dokumentation: BOOKING-E2E-*.md, BOOKING-COMPLIANCE-HANDOVER.md Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e7cc37a15b
commit
eafab8a2cb
47 files changed
+2099
-104
No files matched your search
@@ -18,6 +18,7 @@
|
||||
use App\Tenancy\TenantContextMissing;
|
||||
use Illuminate\Support\Arr;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Illuminate\Support\Facades\Mail;
|
||||
use Throwable;
|
||||
|
||||
@@ -84,7 +85,7 @@ private function create(Property $property, StayRequest $stay, array $guestData,
|
||||
'total' => $quote->total(),
|
||||
'deposit' => $quote->deposit(),
|
||||
'balance_due_on' => $quote->balanceDueOn->toDateString(),
|
||||
'hold_expires_at' => now()->addHours($property->hold_hours),
|
||||
'hold_expires_at' => $property->pre_reservation_enabled ? now()->addHours($property->hold_hours) : null,
|
||||
'message' => $message,
|
||||
'internal_notes' => $differences !== [] ? "Abweichende Angaben in dieser Anfrage (Gästekartei nicht geändert):\n".implode("\n", $differences) : null,
|
||||
]);
|
||||
@@ -138,15 +139,38 @@ private function guestFor(array $guestData): array
|
||||
}
|
||||
|
||||
/**
|
||||
* A failing mail server must not lose the reservation; failures are reported and visible in the log.
|
||||
* Automatic mode first tries to send the offer; the guest then gets the offer instead of the receipt, the
|
||||
* landlord a note either way (with the reasons when the automatic offer was not possible). A failing mail
|
||||
* server or any other error must not lose the reservation; failures are logged without personal data.
|
||||
*/
|
||||
private function sendMails(Booking $booking): void
|
||||
{
|
||||
$blockers = [];
|
||||
$offerSent = false;
|
||||
|
||||
try {
|
||||
Mail::to($booking->guest->email, $booking->guest->full_name)->send(new ReservationReceived($booking));
|
||||
Mail::to(Settings::notificationRecipients())->send(new NewReservation($booking));
|
||||
$auto = app(AutoOffer::class);
|
||||
if ($auto->applies($booking)) {
|
||||
$blockers = $auto->handle($booking);
|
||||
$offerSent = $blockers === [];
|
||||
if (! $offerSent) {
|
||||
$booking->update(['internal_notes' => trim(($booking->internal_notes ? $booking->internal_notes."\n\n" : '')."Automatisches Angebot nicht versendet:\n- ".implode("\n- ", $blockers))]);
|
||||
}
|
||||
$booking->refresh();
|
||||
}
|
||||
} catch (Throwable $exception) {
|
||||
report($exception);
|
||||
Log::warning('Automatisches Angebot fehlgeschlagen', ['booking' => $booking->id, 'exception' => $exception::class]);
|
||||
$blockers = ['Technischer Fehler beim automatischen Angebot – bitte von Hand bearbeiten.'];
|
||||
$offerSent = false;
|
||||
}
|
||||
|
||||
try {
|
||||
if (! $offerSent) {
|
||||
Mail::to($booking->guest->email, $booking->guest->full_name)->send(new ReservationReceived($booking));
|
||||
}
|
||||
Mail::to(Settings::notificationRecipients())->send(new NewReservation($booking, $offerSent, $blockers));
|
||||
} catch (Throwable $exception) {
|
||||
Log::warning('Eingangsmail nicht zugestellt', ['booking' => $booking->id, 'exception' => $exception::class]);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user