Buchungsprozess: Angebots-Snapshot, atomare Annahme, Auto-Angebot, Kanalfreigabe
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:
LarsandClaude Sonnet 5.5 committed 2026-10-30 12:01:02 +01:00
1 parent e7cc37a15b
commit eafab8a2cb
47 files changed
+2099 -104

No files matched your search

@@ -168,6 +168,18 @@ protected function getHeaderActions(): array
Notification::make()->title('Vorgemerkt bis '.$this->record->hold_expires_at->format('d.m.Y, H:i'))->success()->send();
}),
Action::make('resendConfirmation')
->label(fn (): string => $this->record->confirmation_failed_at !== null ? 'Bestätigung erneut senden (Versand fehlgeschlagen)' : 'Bestätigung erneut senden')
->icon(Heroicon::OutlinedEnvelope)
->color(fn (): string => $this->record->confirmation_failed_at !== null ? 'danger' : 'gray')
->visible(fn (): bool => in_array($this->record->status, BookingStatus::occupying(), true))
->requiresConfirmation()
->modalDescription('Die Buchungsbestätigung mit dem Mietvertrag wird noch einmal an den Gast gesendet.')
->action(function (ConfirmBooking $confirm): void {
$sent = $confirm->resend($this->record->fresh());
$notification = Notification::make()->title($sent ? 'Bestätigung gesendet' : 'Versand fehlgeschlagen');
($sent ? $notification->success() : $notification->danger()->body('Details im Postfach.'))->send();
}),
Action::make('contract')
->label('Mietvertrag')
->icon(Heroicon::OutlinedDocumentText)
@@ -180,7 +192,7 @@ protected function getHeaderActions(): array
->icon(Heroicon::OutlinedArrowPath)
->visible(fn (): bool => in_array($this->record->status, [...BookingStatus::occupying()], true))
->requiresConfirmation()
->modalDescription('Der Vertrag wird mit den aktuellen Texten neu erstellt. Der Gast erhält ihn nicht automatisch.')
->modalDescription('Der Vertrag wird mit den Bedingungen des angenommenen Angebots neu erstellt. Der Gast erhält ihn nicht automatisch.')
->action(function (RentalContract $contract): void {
$contract->generate($this->record);
Notification::make()->title('Mietvertrag neu erzeugt')->success()->send();
@@ -68,6 +68,20 @@ public static function configure(Schema $schema): Schema
TextEntry::make('hold_expires_at')->label('Vorgemerkt bis')->dateTime('d.m.Y, H:i')->visible(fn (Booking $record): bool => $record->hold_expires_at !== null),
TextEntry::make('confirmed_at')->label('Bestätigt am')->dateTime('d.m.Y, H:i')->visible(fn (Booking $record): bool => $record->confirmed_at !== null),
TextEntry::make('created_at')->label('Eingegangen')->dateTime('d.m.Y, H:i'),
TextEntry::make('processing')
->label('Bearbeitung / Vorreservierung')
->state(fn (Booking $record): string => $record->property->offer_mode->value === 'automatic' ? 'Automatisch' : 'Manuell')
->visible(fn (Booking $record): bool => $record->isDirect()),
TextEntry::make('offer')
->label('Angebot')
->state(fn (Booking $record): string => 'Version '.$record->offer_version.', gesendet '.$record->offer_sent_at?->format('d.m.Y, H:i').' · Prüfsumme '.substr((string) $record->offer_hash, 0, 12))
->visible(fn (Booking $record): bool => $record->offer_version > 0),
TextEntry::make('accepted_at')->label('Angenommen am')->dateTime('d.m.Y, H:i:s')->visible(fn (Booking $record): bool => $record->accepted_at !== null),
TextEntry::make('confirmation')
->label('Bestätigungs-E-Mail')
->state(fn (Booking $record): string => $record->confirmation_sent_at !== null ? 'Gesendet '.$record->confirmation_sent_at->format('d.m.Y, H:i') : 'Nicht zugestellt – bitte „Bestätigung erneut senden“')
->color(fn (Booking $record): string => $record->confirmation_sent_at !== null ? 'success' : 'danger')
->visible(fn (Booking $record): bool => $record->confirmation_sent_at !== null || $record->confirmation_failed_at !== null),
TextEntry::make('source')->label('Buchungskanal / Quelle')->state(fn (Booking $record): string => $record->bookingChannelLabel()),
TextEntry::make('referral_source')->label('Aufmerksam geworden durch')->placeholder('–'),
TextEntry::make('utm')
@@ -2,14 +2,17 @@
namespace App\Filament\Resources\Properties\Schemas;
use App\Enums\OfferMode;
use App\Filament\Forms\Components\EuroInput;
use App\ImageWorlds\ImageWorldRegistry;
use App\Models\Site;
use Closure;
use Filament\Forms\Components\Select;
use Filament\Forms\Components\TextInput;
use Filament\Forms\Components\TimePicker;
use Filament\Forms\Components\Toggle;
use Filament\Schemas\Components\Section;
use Filament\Schemas\Components\Utilities\Get;
use Filament\Schemas\Components\Utilities\Set;
use Filament\Schemas\Schema;
use Illuminate\Support\Str;
@@ -113,6 +116,22 @@ public static function configure(Schema $schema): Schema
->minValue(1)
->suffix('Stunden')
->default(48),
Toggle::make('pre_reservation_enabled')
->label('Anfrage blockiert den Kalender (Vorreservierung)')
->helperText('Aus: eine bloße Anfrage sperrt keinen Zeitraum. Dann ist kein automatisches Angebot möglich.')
->default(true)
->live(),
Select::make('offer_mode')
->label('Bearbeitung von Anfragen')
->options(OfferMode::class)
->default(OfferMode::Manual)
->required()
->helperText('Automatisch: das Angebot geht sofort an den Gast, wenn die Kalenderprüfung bestanden ist (Kalenderstand aktuell, bei Portalen mit Sofortbuchung unser Feed nachweislich abgerufen). Sonst entscheiden Sie von Hand. Unabhängig vom Testbetrieb der E-Mails.')
->rules([fn (Get $get): Closure => function (string $attribute, mixed $value, Closure $fail) use ($get): void {
if (($value === OfferMode::Automatic->value || $value === OfferMode::Automatic) && ! $get('pre_reservation_enabled')) {
$fail('Automatische Angebote brauchen die Vorreservierung: ohne Sperre im Kalender kann ein verbindlich annehmbares Angebot nicht sicher erteilt werden.');
}
}]),
]),
]);
}