U-A/U-B: Prozesskern mit Fachmodulen, versionierten Modellen, eingefrorenem Prozessplan, ProcessRunner (harte/weiche Abhängigkeiten), CasePricing, Loyalty nur im Tester

CaseActivities/CaseAutomation sind Fassaden über ProcessRunner. Verhaltensvergleich v0.11:
11 Abläufe und 198 Konstellationen gleich, beabsichtigte Abweichungen I-004/I-005 (F-001/F-002).
Volle Suite vor U-B: 785/785.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
LarsandClaude Opus 5.5 committed 2026-11-04 14:49:44 +01:00
1 parent 98df5e9e3b
commit 7e22e12cac
80 files changed
+4628 -445

No files matched your search

+14 -20
View File
@@ -6,6 +6,7 @@
use App\Enums\BookingStatus;
use App\Enums\FactSource;
use App\Enums\IntakeKind;
use App\Enums\ProcessingMode;
use App\Exceptions\ReservationException;
use App\Mail\NewReservation;
use App\Mail\ReservationReceived;
@@ -16,6 +17,7 @@
use App\Pricing\PriceCalculator;
use App\Pricing\QuoteException;
use App\Pricing\StayRequest;
use App\Process\ProcessRunner;
use App\Process\ProcessSettings;
use App\Process\RequestHold;
use App\Support\Settings;
@@ -174,35 +176,27 @@ private function sendMails(Booking $booking): void
{
$blockers = [];
$offerSent = false;
$asked = false;
// The process core answers the request as far as its data allows (Architektur V2, trigger request.created):
// automatic mode sends the offer or information; if details are missing, the data request asks for them
// (and then replaces the receipt) – independently of the offer, which waits for the details.
try {
$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();
$result = app(ProcessRunner::class)->advance($booking, 'request.created');
$offerSent = $result->ran('offer.binding') || $result->ran('offer.information');
$booking->refresh();
if (! $offerSent && $booking->processingMode() === ProcessingMode::Automatic) {
$blockers = [...$result->reasons('offer.binding'), ...$result->reasons('offer.information')];
$booking->update(['internal_notes' => trim(($booking->internal_notes ? $booking->internal_notes."\n\n" : '')."Automatisches Angebot nicht versendet:\n- ".implode("\n- ", $blockers))]);
}
$asked = $result->ran('guest.data_request') && $booking->openDataRequest()?->last_sent_at !== null;
$booking->refresh();
} catch (Throwable $exception) {
Log::warning('Automatisches Angebot fehlgeschlagen', ['booking' => $booking->id, 'exception' => $exception::class]);
$blockers = ['Technischer Fehler beim automatischen Angebot – bitte von Hand bearbeiten.'];
$offerSent = false;
}
// v0.11: details for the offer are missing – the data request asks for them (and then replaces the receipt).
$asked = false;
if (! $offerSent) {
try {
$request = app(RequestCaseData::class)->forNextStep($booking);
$asked = $request?->last_sent_at !== null;
$booking->refresh();
} catch (Throwable $exception) {
Log::warning('Rückfrage fehlgeschlagen', ['booking' => $booking->id, 'exception' => $exception::class]);
}
}
try {
if (! $offerSent && ! $asked && filled($booking->guest?->email)) {
Mail::to($booking->guest->email, $booking->guest->full_name)->send(new ReservationReceived($booking));
+3 -1
View File
@@ -14,6 +14,7 @@
use App\Filament\Resources\Bookings\BookingResource;
use App\Mail\OfferMade;
use App\Models\Booking;
use App\Pricing\CasePricing;
use App\Pricing\PriceCalculator;
use App\Pricing\PriceQuote;
use App\Pricing\QuoteException;
@@ -189,7 +190,8 @@ public function offerUrl(Booking $booking): string
*/
public function quoteFor(Booking $booking, StayRequest $stay, int $adjustment, string $label): PriceQuote
{
$quote = $this->calculator->calculate($booking->property, $stay);
// Extension point BeforePriceFixing (Architektur V2): PriceCalculator plus the lines of contributing modules.
$quote = app(CasePricing::class)->quote($booking, $stay);
if ($adjustment === 0) {
return $quote;
}
+2 -1
View File
@@ -21,6 +21,7 @@
use App\Process\CaseAutomation;
use App\Process\CaseLog;
use App\Process\CaseRequirements;
use App\Process\ProcessRunner;
use App\Support\Inbox;
use App\Support\Money;
use App\Support\Settings;
@@ -148,7 +149,7 @@ public function handle(Booking $booking, int $version, ?string $ip = null): stri
// v0.11 (B3): the binding confirmation needs every detail – ask the guest for what is missing.
if ($outcome === self::PENDING) {
rescue(fn () => app(RequestCaseData::class)->forNextStep($booking->fresh()), report: true);
app(ProcessRunner::class)->advance($booking->fresh(), 'wish');
}
return $outcome;
+4 -4
View File
@@ -13,7 +13,7 @@
use App\Models\Guest;
use App\Models\Property;
use App\Pricing\PortalPrice;
use App\Process\CaseAutomation;
use App\Process\ProcessRunner;
use Carbon\CarbonImmutable;
use Illuminate\Support\Arr;
use Illuminate\Support\Facades\DB;
@@ -96,9 +96,9 @@ public function handle(Property $property, Channel $channel, CarbonImmutable $ar
return $booking->refresh();
});
app(CaseAutomation::class)->advance($booking);
// v0.11 (E-036): the booking stays binding; only missing administrative details of a reachable guest are asked for.
rescue(fn () => app(RequestCaseData::class)->forNextStep($booking->fresh()), report: true);
// The process core sends the documents when everything is there (automatic mode); v0.11 (E-036): the booking
// stays binding, only missing administrative details of a reachable guest are asked for.
app(ProcessRunner::class)->advance($booking, 'booking.taken_over');
return $booking->refresh();
}