Anfrage-Basisprozess inquiry.request mit Schablonen für Antwort und Gastkommunikation
Antwortart (Auskunft/Angebot) und Reservierung sind entkoppelt (neue Einstellung inquiry_answer; pre_reservation bleibt die Reservierungsstrategie). Anlass-bezogene Absender für Anreise-Information und Bewertungsbitte; Schablonen liefern Standardwerte unterhalb aller einstellbaren Ebenen. A1/A2 bleiben Voreinstellungen und Altfassungen. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e40f8639b3
commit
221ce8ca81
51 files changed
+773
-73
No files matched your search
@@ -8,6 +8,7 @@
|
||||
use App\Documents\DocumentFinding;
|
||||
use App\Enums\BookingStatus;
|
||||
use App\Enums\DocumentKind;
|
||||
use App\Enums\InquiryAnswer;
|
||||
use App\Enums\ProcessingMode;
|
||||
use App\Exceptions\ReservationException;
|
||||
use App\Models\Booking;
|
||||
@@ -49,14 +50,16 @@ public function blockers(Booking $booking): array
|
||||
{
|
||||
$property = $booking->property;
|
||||
$reasons = [];
|
||||
$information = ! $booking->process()->preReservation();
|
||||
$information = $booking->process()->inquiryAnswer() === InquiryAnswer::Information;
|
||||
|
||||
if ($information && ($booking->status !== BookingStatus::Reserved || $booking->information_version > 0)) {
|
||||
$reasons[] = 'Die Anfrage ist bereits beantwortet oder nicht mehr offen.';
|
||||
}
|
||||
// A request after its clarification hold (v0.11) only needs free dates, which are checked below.
|
||||
$clarified = $booking->hold_purpose === Booking::HOLD_CLARIFICATION;
|
||||
if (! $information && ($booking->status !== BookingStatus::Reserved || (! $clarified && ! $booking->isHoldActive()))) {
|
||||
// Without a reservation at the request (offer without early hold) the offer itself creates the hold; availability is checked below.
|
||||
$holdRequired = $booking->process()->preReservation();
|
||||
if (! $information && ($booking->status !== BookingStatus::Reserved || ($holdRequired && ! $clarified && ! $booking->isHoldActive()))) {
|
||||
$reasons[] = 'Die Anfrage ist nicht mehr vorgemerkt (Frist abgelaufen oder bereits bearbeitet).';
|
||||
}
|
||||
if (blank($booking->guest?->email)) {
|
||||
@@ -87,7 +90,7 @@ public function handle(Booking $booking): array
|
||||
{
|
||||
$booking->loadMissing(['property', 'guest']);
|
||||
|
||||
if ($booking->process()->preReservation()) {
|
||||
if ($booking->process()->inquiryAnswer() === InquiryAnswer::Offer) {
|
||||
$this->clearance->refresh($booking->property);
|
||||
}
|
||||
|
||||
@@ -97,7 +100,7 @@ public function handle(Booking $booking): array
|
||||
}
|
||||
|
||||
try {
|
||||
if (! $booking->process()->preReservation()) {
|
||||
if ($booking->process()->inquiryAnswer() === InquiryAnswer::Information) {
|
||||
$this->sendInformation->handle($booking->fresh(), ['expected_version' => 0, 'acknowledged' => true]);
|
||||
} else {
|
||||
$this->sendOffer->handle($booking->fresh(), ['expected_version' => 0]);
|
||||
|
||||
Reference in new issue
Block a user