Ein Eingang fuer alle Kanaele (Paket 4, Prozessarchitektur v0.10)
Portalbuchungen und -anfragen aus Kalender und Mail werden ueber PortalIntake zum Vorgang (nur bei sicherer Erkennung), Dubletten ueber Buchungsnummer, gleiches Portal mit gleichen Naechten und Spiegelung; Unsicheres wird geklaert. Portalstorno und -aenderung als Aufgabe am Vorgang ohne stille Stornierung. Schalter je Kanal (Aus als Standard, Beobachten, Anlegen, Anlegen + weiter), Eingangsprotokoll, Bestandsuebernahme mit Vorschau/Bericht/Ruecknahme, Sperrnachweis in drei Stufen. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
cf11c8a474
commit
ac9d20b812
29 files changed
+1952
-16
No files matched your search
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\Enums\IntakeOutcome;
|
||||
use App\Models\IntakeObservation;
|
||||
use App\Models\Tenant;
|
||||
use App\Tenancy\TenantRunner;
|
||||
use Illuminate\Console\Attributes\Description;
|
||||
use Illuminate\Console\Attributes\Signature;
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
#[Signature('channels:intake-report {--days=14 : Zeitraum in Tagen}')]
|
||||
#[Description('Bericht des Eingangsprotokolls: was über die Portale hereinkam und welche Vorgänge entstanden sind oder entstanden wären')]
|
||||
class IntakeReport extends Command
|
||||
{
|
||||
public function handle(TenantRunner $runner): int
|
||||
{
|
||||
$runner->each(function (Tenant $tenant): void {
|
||||
$observations = IntakeObservation::query()->with(['channel', 'booking'])
|
||||
->where('occurred_at', '>=', now()->subDays((int) $this->option('days')))->orderBy('occurred_at')->get();
|
||||
|
||||
$this->line("<options=bold>{$tenant->name}</>: ".$observations->count().' Einträge');
|
||||
$this->table(['Wann', 'Portal', 'Quelle', 'Zeitraum', 'Ergebnis', 'Ausgeführt', 'Vorgang', 'Begründung'], $observations->map(fn (IntakeObservation $observation): array => [
|
||||
$observation->occurred_at->format('d.m. H:i'),
|
||||
$observation->channel?->name,
|
||||
$observation->sourceLabel(),
|
||||
$observation->starts_on ? $observation->starts_on->format('d.m.').'–'.$observation->ends_on?->format('d.m.Y') : '–',
|
||||
$observation->outcome->getLabel(),
|
||||
$observation->applied ? 'ja' : 'nur protokolliert',
|
||||
$observation->booking?->reference ?? '–',
|
||||
implode(' ', (array) $observation->reasons),
|
||||
])->all());
|
||||
|
||||
$wouldCreate = $observations->filter(fn (IntakeObservation $observation): bool => ! $observation->applied && in_array($observation->outcome, [IntakeOutcome::Create, IntakeOutcome::Inquiry], true))->count();
|
||||
$this->info("Wären entstanden (Beobachten): {$wouldCreate}");
|
||||
});
|
||||
|
||||
return self::SUCCESS;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user