U-D/U-E/O5: Prozess-Tester im eigenen Prozess (standardmäßig gesperrt, 15 Negativtests, statischer Wächter), Szenarien und Bericht, Kanalereignisse (API-Eingang ohne Umbau von iCal/Mail), Abschluss nach finanzieller Klärung, Löschfrist 30 Tage

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
LarsandClaude Opus 5.5 committed 2026-11-04 15:34:40 +01:00
1 parent c255783cec
commit 0689c0a591
68 files changed
+3350 -35

No files matched your search

@@ -0,0 +1,103 @@
<x-filament-panels::page>
@php
$muted = 'color:#6b7280;font-size:.8rem';
$input = 'border:1px solid rgba(128,128,128,.4);border-radius:.375rem;padding:.3rem .45rem;background:transparent';
$card = 'border:1px solid rgba(128,128,128,.3);border-radius:.5rem;padding:.75rem 1rem;margin-bottom:.6rem';
$requirements = $this->requirements();
$scenarios = $this->scenarios();
$run = $this->run();
$report = $run?->report ?? [];
$stateColor = ['done' => '#15803d', 'external' => '#0369a1', 'open' => '#b45309', 'problem' => '#b91c1c', 'waiting' => '#6d28d9', 'later' => '#6b7280', 'not_applicable' => '#9ca3af'];
@endphp
<x-filament::section heading="So funktioniert der Test" collapsible collapsed>
<p style="font-size:.9rem">Der Test spielt einen ausgedachten Vorgang mit Ihrer aktuellen – auch noch nicht gespeicherten – Einstellung durch. Er nutzt dieselben Abläufe wie ein echter Vorgang, aber in einem eigenen, abgeschotteten Lauf: eigene Testdatenbank, keine echten Gäste, keine Mails an echte Empfänger, keine Portale, keine Kalender. Mails werden nur angezeigt. Links in den Mails sind nur Text.</p>
</x-filament::section>
@if ($requirements !== [])
<x-filament::section heading="Der Prozess-Tester ist auf diesem Server gesperrt">
<ul style="color:#b91c1c;font-size:.9rem;list-style:disc;padding-left:1.2rem">
@foreach ($requirements as $requirement)<li>{{ $requirement }}</li>@endforeach
</ul>
<p style="{{ $muted }}">Ohne diese Voraussetzungen lässt sich die Trennung von den echten Daten nicht sicher herstellen. Es gibt deshalb keinen Ausweichbetrieb.</p>
</x-filament::section>
@else
<x-filament::section heading="Szenario">
<p style="{{ $muted }}">Ablauf: {{ app(\App\Process\ProcessCatalogue::class)->model($this->draft['model'])::label() }}{{ ($this->draft['variant'] ?? 'standard') !== 'standard' ? ' · Variante '.$this->draft['variant'] : '' }} · {{ $this->intake === 'booking' ? 'feste Buchungen' : 'Anfragen' }} über {{ $this->record->name }}</p>
<div style="display:flex;flex-wrap:wrap;gap:.8rem;align-items:end;margin-top:.5rem">
<label style="font-size:.85rem">Szenario
<select wire:model.live="scenario" style="{{ $input }};display:block">
@foreach ($scenarios as $key => $class)<option value="{{ $key }}">{{ $class::label() }}</option>@endforeach
</select>
</label>
@if ($class = $scenarios[$this->scenario] ?? null)
@foreach ($class::inputs() as $key => $definition)
<label style="font-size:.85rem">{{ $definition['label'] }}
@if ($definition['type'] === 'bool')
<input type="checkbox" wire:model="inputs.{{ $key }}" style="display:block">
@elseif ($definition['type'] === 'select')
<select wire:model="inputs.{{ $key }}" style="{{ $input }};display:block">
@foreach ($definition['options'] as $value => $label)<option value="{{ $value }}">{{ $label }}</option>@endforeach
</select>
@else
<input type="{{ $definition['type'] === 'date' ? 'date' : 'number' }}" wire:model="inputs.{{ $key }}" style="{{ $input }};display:block;width:10rem">
@endif
</label>
@endforeach
@endif
</div>
@if ($class)<p style="font-size:.85rem;margin-top:.5rem">{{ $class::description() }}</p>@endif
<div style="display:flex;gap:.5rem;margin-top:.8rem">
<x-filament::button wire:click="start" wire:loading.attr="disabled">Test starten</x-filament::button>
@if ($run && count($report['timeline'] ?? []) < ($report['scenario']['available_events'] ?? 0) && blank($report['aborted'] ?? null))
<x-filament::button color="gray" wire:click="next" wire:loading.attr="disabled">Weiter: nächstes Ereignis</x-filament::button>
@endif
<span wire:loading style="{{ $muted }}">Testlauf läuft …</span>
</div>
</x-filament::section>
@endif
@if ($run)
<x-filament::section heading="Bericht">
@if (filled($report['aborted'] ?? null))
<p style="color:#b91c1c;font-weight:600">{{ $report['aborted'] }}</p>
@foreach ($report['violations'] ?? [] as $violation)<p style="color:#b91c1c;font-size:.85rem">{{ $violation['message'] ?? '' }}</p>@endforeach
@endif
@if ($plan = $report['plan'] ?? null)
<p style="font-size:.9rem"><strong>{{ $plan['label'] }}</strong> ({{ $plan['model'] }} Version {{ $plan['version'] }}{{ $plan['variant'] !== 'standard' ? ', Variante '.$plan['variant'] : '' }}) · Vorgangsart {{ $plan['case_type'] }}</p>
<details style="font-size:.85rem;margin:.4rem 0"><summary>Wirksame Einstellungen</summary>
<ul style="padding-left:1.2rem;list-style:disc">
@foreach ($plan['configuration'] as $row)<li>{{ $row['question'] }}: <strong>{{ $row['value'] }}</strong> <span style="{{ $muted }}">({{ $row['source'] }})</span></li>@endforeach
</ul>
</details>
@endif
@foreach ($report['timeline'] ?? [] as $index => $event)
<div style="{{ $card }}">
<div style="display:flex;justify-content:space-between"><strong>{{ $index + 1 }}. {{ $event['label'] }}</strong><span style="{{ $muted }}">{{ $event['at'] }} (simuliert)</span></div>
@if ($event['error'])<p style="color:#b91c1c;font-size:.85rem">Fehler: {{ $event['error'] }}</p>@endif
@isset($event['situation'])<p style="font-size:.85rem;margin:.3rem 0">{{ $event['status'] }} · {{ $event['situation'] }}</p>@endisset
<ul style="font-size:.85rem;list-style:none;padding:0">
@foreach ($event['activities'] as $activity)
<li><span style="color:{{ $stateColor[$activity['state_key']] ?? '#6b7280' }};font-weight:600">{{ $activity['state'] }}</span> – {{ $activity['label'] }}@if ($activity['detail'])<span style="{{ $muted }}"> · {{ $activity['detail'] }}</span>@endif</li>
@endforeach
</ul>
@if (($event['skipped'] ?? []) !== [])
<p style="{{ $muted }};margin-top:.3rem">Übersprungen: {{ collect($event['skipped'])->map(fn ($skipped) => $skipped['label'].' ('.$skipped['reason'].')')->implode(', ') }}</p>
@endif
@if (isset($event['calendar']))
<p style="{{ $muted }}">Kalender: {{ $event['calendar']['occupying'] ? 'Zeitraum belegt' : 'Zeitraum frei' }}{{ $event['calendar']['hold_until'] ? ', reserviert bis '.$event['calendar']['hold_until'] : '' }} · Preis: {{ $event['price']['total'] !== null ? \App\Support\Money::format($event['price']['total']) : 'noch offen' }}</p>
@endif
@foreach ($event['mails'] as $mail)
<details style="font-size:.85rem;margin-top:.3rem"><summary>✉ simuliert: {{ $mail['subject'] }} <span style="{{ $muted }}">an {{ $mail['to'] }}</span></summary><p style="{{ $muted }}">{{ $mail['excerpt'] }}</p></details>
@endforeach
</div>
@endforeach
@if ($result = $report['result'] ?? null)
<p style="font-size:.9rem"><strong>Ergebnis:</strong> {{ $result['status'] }} · {{ $result['situation'] }}@if ($result['next']) · nächster Schritt: {{ $result['next'] }}@endif</p>
@endif
<p style="{{ $muted }}">Bericht Nr. {{ $run->id }} vom {{ $run->created_at->format('d.m.Y H:i') }} · wird nach {{ config('fewo.retention.process_test_run_days') }} Tagen gelöscht.</p>
</x-filament::section>
@endif
</x-filament-panels::page>
@@ -130,9 +130,8 @@
@endforeach
</ol>
<p style="{{ $muted }};margin-top:.6rem">Gilt für neue Vorgänge. Laufende Vorgänge dieses Kanals ({{ $this->runningCases() }}) behalten ihren bisherigen Ablauf.</p>
@if (\Illuminate\Support\Facades\Route::has('filament.admin.resources.channels.test'))
<x-filament::button tag="a" color="gray" :href="\App\Filament\Resources\Channels\ChannelResource::getUrl('test', ['record' => $this->record, 'intake' => $this->intake])" style="margin-top:.6rem">Ablauf testen</x-filament::button>
@endif
<x-filament::button color="gray" wire:click="test" style="margin-top:.6rem">Ablauf testen</x-filament::button>
<p style="{{ $muted }}">Spielt einen ausgedachten Vorgang mit genau dieser Einstellung durch – ohne Wirkung auf echte Daten.</p>
</x-filament::section>
</div>
</x-filament-panels::page>