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:
1 parent
c255783cec
commit
0689c0a591
68 files changed
+3350
-35
No files matched your search
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
namespace App\Process\Tester\Scenarios;
|
||||
|
||||
use App\Actions\ContributeCaseFacts;
|
||||
use App\Enums\FactSource;
|
||||
use App\Enums\IntakeKind;
|
||||
use App\Process\Tester\SandboxContext;
|
||||
|
||||
/**
|
||||
* S02/S03/S04/S05: a request without address – clarification hold and data request run side by side, the hold
|
||||
* expires, the guest answers later (by link or by e-mail), the offer follows; finally the offer's deadline passes.
|
||||
*/
|
||||
final class MissingAddress extends Scenario
|
||||
{
|
||||
public static function key(): string
|
||||
{
|
||||
return 'missing_address';
|
||||
}
|
||||
|
||||
public static function label(): string
|
||||
{
|
||||
return 'Fehlende Anschrift, späte Antwort';
|
||||
}
|
||||
|
||||
public static function description(): string
|
||||
{
|
||||
return 'Die Anfrage kommt ohne Anschrift: Rückfrage beim Gast und Klärungsreservierung laufen nebeneinander, die Reservierung läuft ab, der Gast antwortet später.';
|
||||
}
|
||||
|
||||
public static function intakes(): array
|
||||
{
|
||||
return [IntakeKind::Inquiry];
|
||||
}
|
||||
|
||||
public static function inputs(): array
|
||||
{
|
||||
return [
|
||||
...parent::inputs(),
|
||||
'answer_after_hours' => ['label' => 'Antwort des Gastes nach (Stunden)', 'default' => 26, 'type' => 'int'],
|
||||
'answer_by' => ['label' => 'Antwort über', 'default' => 'link', 'type' => 'select', 'options' => ['link' => 'Link im Formular', 'email' => 'E-Mail (ausgewertete Angaben)']],
|
||||
];
|
||||
}
|
||||
|
||||
public function events(array $inputs): array
|
||||
{
|
||||
return [
|
||||
new ScenarioEvent('Gast fragt ohne Anschrift an', fn (SandboxContext $context) => $context->request([])),
|
||||
new ScenarioEvent('Zwei Stunden vergehen (Klärungsfrist)', fn (SandboxContext $context) => $context->travel(125)),
|
||||
new ScenarioEvent('Gast antwortet mit seiner Anschrift', function (SandboxContext $context) use ($inputs): void {
|
||||
$context->travel(max(0, (int) ($inputs['answer_after_hours'] ?? 26) * 60 - 125));
|
||||
app(ContributeCaseFacts::class)->handle($context->booking->fresh(), ['guest.street' => 'Teststraße 1', 'guest.postal_code' => '18225', 'guest.city' => 'Kühlungsborn', 'guest.country' => 'DE'], ($inputs['answer_by'] ?? 'link') === 'email' ? FactSource::Email : FactSource::GuestLink);
|
||||
}),
|
||||
new ScenarioEvent('Die Angebotsfrist vergeht ohne Annahme', fn (SandboxContext $context) => $context->travel(73 * 60)),
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user