V2.1: Kanalfähigkeiten, Ausführungsvarianten, Dokumentenentkopplung, Portalbestätigung

Modellwahl über Kanalfähigkeiten mit erklärten Einschränkungen, Abgleich alter Werte,
Ausführungsvarianten je Modul, getrennte Vertrags-/Buchungsinformation, Warten auf
die Portalbestätigung mit Eskalation und Wiederaufnahme (Fälle C und D getestet).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
LarsandClaude Sonnet 5.5 committed 2026-11-05 07:54:11 +01:00
1 parent ef1635e59a
commit 8442d0a3d8
62 files changed
+1818 -69

No files matched your search

@@ -0,0 +1,47 @@
<?php
namespace App\Console\Commands;
use App\Models\Booking;
use App\Models\Tenant;
use App\Process\ProcessRunner;
use App\Tenancy\TenantRunner;
use Illuminate\Console\Attributes\Description;
use Illuminate\Console\Attributes\Signature;
use Illuminate\Console\Command;
use Throwable;
/**
* Evaluates binding bookings that wait for an event again (V2.1, docs/Prozessarchitektur/V2.1/02 §5): the portal's
* confirmation mail did not come in time (escalate once), came meanwhile (close the escalation, go on) – without this nothing
* would resume or time out, because no scheduler looks at binding cases. Only cases whose channel makes them wait are
* touched; once per landlord.
*/
#[Signature('bookings:advance-waiting')]
#[Description('Re-evaluate binding bookings that wait for a portal confirmation (deadline, escalation, resume) – once per landlord')]
class AdvanceWaitingCases extends Command
{
public function handle(TenantRunner $tenants, ProcessRunner $runner): int
{
$tenants->each(function (Tenant $tenant) use ($runner): void {
$evaluated = 0;
Booking::query()->occupying()->where('intake', 'booking')->where('created_at', '>', now()->subDays(90))
->with(['property', 'guest', 'importChannel', 'originChannel'])
->each(function (Booking $booking) use ($runner, &$evaluated): void {
if (! $booking->process()->awaitsPortalConfirmation()) {
return;
}
try {
$runner->advance($booking, 'schedule:waiting');
$evaluated++;
} catch (Throwable $exception) {
report($exception);
}
});
$this->info("{$tenant->name}: {$evaluated} wartende Vorgang/Vorgänge bewertet.");
});
return self::SUCCESS;
}
}