Files
fewo-stommer/app/Process/Modules/Intake/Hold.php
T
LarsandClaude Sonnet 5.5 8442d0a3d8 V2.1: Kanalfähigkeiten, Ausführungsvarianten, Dokumentenentkopplung, Portalbestätigung
Modellwahl über Kanalfähigkeiten mit erklärten Einschränkungen, Abgleich alter Werte,
Ausführungsvarianten je Modul, getrennte Vertrags-/Buchungsinformation, Warten auf
die Portalbestätigung mit Eskalation und Wiederaufnahme (Fälle C und D getestet).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-05 07:54:11 +01:00

67 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 App\Process\Modules\Intake;
use App\Enums\Execution;
use App\Enums\ProcessSetting;
use App\Models\Booking;
use App\Process\CaseContext;
use App\Process\Modules\Dependency;
use App\Process\Modules\Module;
use App\Process\Modules\ModuleDefinition;
use App\Process\Modules\StepState;
/**
* P01/P02: the hold of a request – clarification hold of an incomplete request or offer hold – and its deadline. It is
* set by the intake (RequestHold under the calendar lock) and by SendOffer, it ends by ExpireReservations or the
* release; this step only watches it. It depends on the intake alone, never on the guest's details, so a request that
* waits for its address keeps its clarification hold running (requirement K1/T1).
*/
final class Hold extends Module
{
public static function key(): string
{
return 'hold';
}
public static function definition(): ModuleDefinition
{
return new ModuleDefinition(
label: 'Reservierung des Zeitraums',
purpose: 'Hält den Zeitraum während der Klärung bzw. der Angebotsfrist frei und gibt ihn nach Ablauf wieder frei.',
phase: 'P01',
executions: [Execution::Automatic],
condition: 'bei einer Anfrage, die den Zeitraum reservieren soll',
requires: [Dependency::hard('intake.record')],
effects: ['calendar_hold'],
waits: ['time'],
triggers: ['intake', 'offer.sent', 'schedule:bookings:expire-holds'],
parameters: [ProcessSetting::PreReservation, ProcessSetting::HoldHours, ProcessSetting::ClarificationHoldAutoMinutes, ProcessSetting::ClarificationHoldManualMinutes],
toggle: ModuleDefinition::TOGGLE_CONDITIONAL,
events: ['hold'],
);
}
public function applies(CaseContext $case): bool
{
return $case->inquiry && $case->profile->preReservation();
}
/** The hold has no line of its own: the offer step and the situation show it. */
public function activities(CaseContext $case): array
{
return [];
}
public function state(CaseContext $case): ?StepState
{
$booking = $case->booking;
return match (true) {
$booking->isHoldActive() => StepState::Waiting,
$booking->hold_expires_at === null && $booking->hold_purpose === Booking::HOLD_CLARIFICATION => StepState::NotApplicable,
default => StepState::Done,
};
}
}