43 lines
1.3 KiB
PHP
43 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace App\Process\Tester\Scenarios;
|
|
|
|
use App\Enums\IntakeKind;
|
|
|
|
/**
|
|
* A predefined tester scenario (decision E9): a fixed sequence of events through the same entry points as the real
|
|
* application; the landlord may change its inputs (dates, guests, missing details, returning guest, kind of failure),
|
|
* never the sequence.
|
|
*/
|
|
abstract class Scenario
|
|
{
|
|
abstract public static function key(): string;
|
|
|
|
abstract public static function label(): string;
|
|
|
|
abstract public static function description(): string;
|
|
|
|
/** @return list<IntakeKind> */
|
|
abstract public static function intakes(): array;
|
|
|
|
/**
|
|
* Inputs the landlord may change, with their defaults.
|
|
*
|
|
* @return array<string, array{label: string, default: string|int|bool, type: 'date'|'int'|'bool'|'select', options?: array<string, string>}>
|
|
*/
|
|
public static function inputs(): array
|
|
{
|
|
return [
|
|
'arrival' => ['label' => 'Anreise', 'default' => '+21 days', 'type' => 'date'],
|
|
'nights' => ['label' => 'Nächte', 'default' => 4, 'type' => 'int'],
|
|
'guests' => ['label' => 'Personen', 'default' => 2, 'type' => 'int'],
|
|
];
|
|
}
|
|
|
|
/**
|
|
* @param array<string, mixed> $inputs
|
|
* @return list<ScenarioEvent>
|
|
*/
|
|
abstract public function events(array $inputs): array;
|
|
}
|