Files
fewo-stommer/tests/Support/Process/AddressVerification.php
T
LarsandClaude Opus 5.5 7e22e12cac U-A/U-B: Prozesskern mit Fachmodulen, versionierten Modellen, eingefrorenem Prozessplan, ProcessRunner (harte/weiche Abhängigkeiten), CasePricing, Loyalty nur im Tester
CaseActivities/CaseAutomation sind Fassaden über ProcessRunner. Verhaltensvergleich v0.11:
11 Abläufe und 198 Konstellationen gleich, beabsichtigte Abweichungen I-004/I-005 (F-001/F-002).
Volle Suite vor U-B: 785/785.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 14:49:44 +01:00

78 lines
2.4 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
namespace Tests\Support\Process;
use App\Enums\ActivityState;
use App\Process\Activity;
use App\Process\CaseContext;
use App\Process\Modules\Dependency;
use App\Process\Modules\Module;
use App\Process\Modules\ModuleDefinition;
use App\Process\Modules\RunsAutomatically;
use App\Process\Modules\StepState;
use App\Process\StepResult;
/**
* The test case of the module criteria (docs/Prozessarchitektur/Architektur/02 §2.1): an external address check is a
* module of its own – own result, own effect (network), own waiting state, own evidence, switchable per channel. Not
* part of the application; it shows that such a module fits at an existing extension point without changing other
* models, and that its waiting does not hold back steps that do not depend on it.
*/
final class AddressVerification extends Module implements RunsAutomatically
{
public static bool $serviceAvailable = true;
public static function key(): string
{
return 'guest.address_verification';
}
public static function definition(): ModuleDefinition
{
return new ModuleDefinition(
label: 'Anschrift extern prüfen',
purpose: 'Prüft die Anschrift bei einem Adressdienst.',
phase: 'P01',
requires: [Dependency::hard('guest.details')],
effects: ['network', 'case_write'],
waits: ['time'],
triggers: ['automation'],
toggle: ModuleDefinition::TOGGLE_OPTIONAL,
modes: ['automatic'],
points: ['after_guest_identified'],
);
}
public function activities(CaseContext $case): array
{
$state = $this->state($case);
return [new Activity('address_check', 'Anschrift extern prüfen', $state === StepState::Done ? ActivityState::Done : ActivityState::Waiting, self::$serviceAvailable ? null : 'Adressdienst nicht erreichbar – neuer Versuch später')];
}
public function state(CaseContext $case): ?StepState
{
return self::$serviceAvailable ? StepState::Done : StepState::Waiting;
}
public function due(CaseContext $case): bool
{
return ! self::$serviceAvailable;
}
public function blockers(CaseContext $case): array
{
return [];
}
public function run(CaseContext $case): StepResult
{
return StepResult::blocked(['Adressdienst nicht erreichbar.']);
}
public function isOutward(): bool
{
return false;
}
}