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:
1 parent
3bcfc09417
commit
40d20cb7d1
52 files changed
+3196
-89
No files matched your search
@@ -19,6 +19,9 @@
|
||||
* Automatic offer processing (property setting "Automatisch"): sends the offer without the landlord when every
|
||||
* release rule is met, otherwise leaves the request untouched for manual processing and says why.
|
||||
*
|
||||
* A request without a hold (pre-reservation "no") gets the information "unter Vorbehalt" instead of the offer (package 7);
|
||||
* its rules are the same except the reservation.
|
||||
*
|
||||
* Rules: pre-reservation active (the dates are really blocked), guest e-mail known, dates still free, contract
|
||||
* texts released by the landlord (not the sample text; skipped while mails only go to the test recipient),
|
||||
* the calendar clearance of {@see CalendarClearance} (fresh imports, instant-booking portals fetched our feed) and an
|
||||
@@ -30,6 +33,7 @@ public function __construct(
|
||||
private SendOffer $sendOffer,
|
||||
private CalendarClearance $clearance,
|
||||
private AvailabilityChecker $availability,
|
||||
private SendInformation $sendInformation,
|
||||
) {}
|
||||
|
||||
public function applies(Booking $booking): bool
|
||||
@@ -44,11 +48,12 @@ public function blockers(Booking $booking): array
|
||||
{
|
||||
$property = $booking->property;
|
||||
$reasons = [];
|
||||
$information = ! $booking->process()->preReservation();
|
||||
|
||||
if (! $booking->process()->preReservation()) {
|
||||
$reasons[] = 'Anfragen reservieren den Zeitraum nicht (Einstellung „Vorreservierung“); ohne Sperre im Kalender wird kein Angebot automatisch erteilt.';
|
||||
if ($information && ($booking->status !== BookingStatus::Reserved || $booking->information_version > 0)) {
|
||||
$reasons[] = 'Die Anfrage ist bereits beantwortet oder nicht mehr offen.';
|
||||
}
|
||||
if ($booking->status !== BookingStatus::Reserved || ! $booking->isHoldActive()) {
|
||||
if (! $information && ($booking->status !== BookingStatus::Reserved || ! $booking->isHoldActive())) {
|
||||
$reasons[] = 'Die Anfrage ist nicht mehr vorgemerkt (Frist abgelaufen oder bereits bearbeitet).';
|
||||
}
|
||||
if (blank($booking->guest?->email)) {
|
||||
@@ -61,10 +66,11 @@ public function blockers(Booking $booking): array
|
||||
$reasons[] = 'Mietbedingungen, Stornobedingungen oder Bankverbindung sind noch nicht vom Betreiber freigegeben (leer oder Mustertext).';
|
||||
}
|
||||
|
||||
// Status, e-mail, dates and the missing reservation are checked above; the composition adds what concerns the document.
|
||||
$reasons = [...$reasons, ...app(DocumentComposer::class)->compose($booking, DocumentKind::Offer)->toConfirm(except: [DocumentFinding::HOLD_ZERO])];
|
||||
// Status, e-mail and dates are checked above; the composition adds what concerns the document.
|
||||
$reasons = [...$reasons, ...app(DocumentComposer::class)->compose($booking, $information ? DocumentKind::Information : DocumentKind::Offer)->toConfirm(except: [DocumentFinding::HOLD_ZERO])];
|
||||
|
||||
return [...$reasons, ...$this->clearance->reasons($property, $booking->created_at)];
|
||||
// An information reserves nothing and binds nobody: the calendar is checked again when the guest asks for the booking.
|
||||
return $information ? $reasons : [...$reasons, ...$this->clearance->reasons($property, $booking->created_at)];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -86,7 +92,11 @@ public function handle(Booking $booking): array
|
||||
}
|
||||
|
||||
try {
|
||||
$this->sendOffer->handle($booking->fresh(), ['expected_version' => 0]);
|
||||
if (! $booking->process()->preReservation()) {
|
||||
$this->sendInformation->handle($booking->fresh(), ['expected_version' => 0, 'acknowledged' => true]);
|
||||
} else {
|
||||
$this->sendOffer->handle($booking->fresh(), ['expected_version' => 0]);
|
||||
}
|
||||
} catch (QuoteException|ReservationException $exception) {
|
||||
// A mail failure keeps the saved offer (SendOffer reports it in the inbox); the landlord can resend the link.
|
||||
return [$exception->getMessage()];
|
||||
|
||||
Reference in new issue
Block a user