Files
fewo-stommer/app/Process/CaseAutomation.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

39 lines
1.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;
use App\Models\Booking;
/**
* Facade of the process core (ProcessRunner, trigger 'automation') for the places that carry a case on after new
* facts, portal amounts or the landlord's "continue automatically": only what the landlord would do next anyway and
* only when the case is handled automatically – the offer or information of a request, the documents of a binding
* booking (never for cases taken over from the old data). Whatever stops it is returned in plain words.
*/
class CaseAutomation
{
public function __construct(private ProcessRunner $runner) {}
/**
* @return list<string> what keeps the case from going on automatically (empty: nothing to do or done)
*/
public function advance(Booking $booking): array
{
return $this->runner->advance($booking, ProcessRunner::AUTOMATION)->reasons();
}
/**
* What is missing before the documents of a binding case can go to the guest.
*
* @return list<string>
*/
public function documentBlockers(Booking $booking): array
{
return array_values(array_filter([
$booking->guest === null ? 'Name und Kontaktdaten des Gastes fehlen.' : null,
$booking->guest !== null && blank($booking->guest->email) ? 'Die E-Mail-Adresse des Gastes fehlt.' : null,
$booking->total === null ? 'Der Gesamtpreis (laut Portal) fehlt.' : null,
]));
}
}