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\AcceptOffer;
|
||||
use App\Actions\SendOffer;
|
||||
use App\Enums\BookingStatus;
|
||||
use App\Enums\IntakeKind;
|
||||
use App\Process\Tester\SandboxContext;
|
||||
|
||||
/**
|
||||
* S01/S06/S11: a complete request – offer (automatic or by the landlord), acceptance, binding booking, arrival, after
|
||||
* departure (review request, closing; a switched-off step is shown as skipped).
|
||||
*/
|
||||
final class CompleteRequest extends Scenario
|
||||
{
|
||||
public static function key(): string
|
||||
{
|
||||
return 'complete_request';
|
||||
}
|
||||
|
||||
public static function label(): string
|
||||
{
|
||||
return 'Vollständige Anfrage bis zur Buchung';
|
||||
}
|
||||
|
||||
public static function description(): string
|
||||
{
|
||||
return 'Ein Gast fragt mit allen Angaben an, erhält das Angebot und nimmt es an; danach Anreise und Abreise.';
|
||||
}
|
||||
|
||||
public static function intakes(): array
|
||||
{
|
||||
return [IntakeKind::Inquiry];
|
||||
}
|
||||
|
||||
public function events(array $inputs): array
|
||||
{
|
||||
return [
|
||||
new ScenarioEvent('Gast fragt mit allen Angaben an', fn (SandboxContext $context) => $context->request(['street' => 'Teststraße 1', 'postal_code' => '18225', 'city' => 'Kühlungsborn', 'country' => 'DE'])),
|
||||
new ScenarioEvent('Sie senden das Angebot (falls es nicht automatisch ging)', function (SandboxContext $context): void {
|
||||
$booking = $context->booking->fresh();
|
||||
if ($booking->status === BookingStatus::Reserved && $booking->offer_version === 0 && $booking->process()->preReservation()) {
|
||||
app(SendOffer::class)->handle($booking);
|
||||
}
|
||||
}),
|
||||
new ScenarioEvent('Gast nimmt das Angebot an', function (SandboxContext $context): void {
|
||||
$booking = $context->booking->fresh();
|
||||
if ($booking->status === BookingStatus::OfferSent) {
|
||||
app(AcceptOffer::class)->handle($booking, $booking->offer_version);
|
||||
}
|
||||
}),
|
||||
new ScenarioEvent('Zwei Tage vor der Anreise', fn (SandboxContext $context) => $context->travelTo($context->arrival()->subDays(2)->setTime(9, 0))),
|
||||
new ScenarioEvent('Drei Tage nach der Abreise', fn (SandboxContext $context) => $context->travelTo($context->departure()->addDays(3)->setTime(9, 0))),
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user