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>
51 lines
1.8 KiB
PHP
51 lines
1.8 KiB
PHP
<?php
|
||
|
||
namespace App\Process\Modules\Settlement;
|
||
|
||
use App\Enums\ActivityState;
|
||
use App\Enums\Execution;
|
||
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',
|
||
executions: [Execution::Manual, Execution::NotRequired],
|
||
condition: 'bei einer privaten Überlassung mit Gästen',
|
||
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)];
|
||
}
|
||
}
|