Files
fewo-stommer/app/Process/Modules/Settlement/StayConfirmation.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

48 lines
1.7 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\Settlement;
use App\Enums\ActivityState;
use App\Enums\InternalKind;
use App\Process\Activity;
use App\Process\CaseContext;
use App\Process\Modules\Module;
use App\Process\Modules\ModuleDefinition;
/**
* A6: an optional stay confirmation for the guests of an own use or private stay (no rental contract).
*/
final class StayConfirmation extends Module
{
public static function key(): string
{
return 'documents.stay_confirmation';
}
public static function definition(): ModuleDefinition
{
return new ModuleDefinition(
label: 'Aufenthaltsbestätigung',
purpose: 'Bestätigt den Gästen einer Eigenbelegung oder privaten Überlassung den Aufenthalt – nur bei Bedarf.',
phase: 'P03',
effects: ['guest_mail', 'document'],
toggle: ModuleDefinition::TOGGLE_OPTIONAL,
performers: ['landlord'],
events: ['document', 'mail'],
);
}
public function applies(CaseContext $case): bool
{
return $case->booking->internal_kind !== InternalKind::Block && filled($case->booking->guest?->email);
}
public function activities(CaseContext $case): array
{
$booking = $case->booking;
return [new Activity('documents', 'Aufenthaltsbestätigung an die Gäste (optional)', $case->later($booking->confirmation_sent_at !== null ? ActivityState::Done : ActivityState::Later),
$booking->confirmation_sent_at ? 'gesendet am '.$booking->confirmation_sent_at->format('d.m.Y') : 'nur bei Bedarf', $booking->confirmation_sent_at === null && ! $case->closed ? 'sendDocuments' : null)];
}
}