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>
52 lines
2.2 KiB
PHP
52 lines
2.2 KiB
PHP
<?php
|
||
|
||
namespace App\Process\Modules\Stay;
|
||
|
||
use App\Enums\ActivityState;
|
||
use App\Enums\Execution;
|
||
use App\Enums\ProcessSetting;
|
||
use App\Enums\Responsibility;
|
||
use App\Process\Activity;
|
||
use App\Process\CaseContext;
|
||
use App\Process\Modules\Module;
|
||
use App\Process\Modules\ModuleDefinition;
|
||
|
||
/**
|
||
* P04: the arrival information for the guest – sent by us (SendBookingReminders) or announced by the portal. Who sends
|
||
* it is variable within the model (supplementary, not contract documentation; decision O1).
|
||
*/
|
||
final class ArrivalInformation extends Module
|
||
{
|
||
public static function key(): string
|
||
{
|
||
return 'arrival.info';
|
||
}
|
||
|
||
public static function definition(): ModuleDefinition
|
||
{
|
||
return new ModuleDefinition(
|
||
label: 'Anreise-Informationen',
|
||
purpose: 'Wegbeschreibung, Schlüssel und Kontakt vor Ort rechtzeitig vor der Anreise.',
|
||
phase: 'P04',
|
||
executions: [Execution::Automatic, Execution::Portal, Execution::ServiceProvider, Execution::NotRequired],
|
||
condition: 'bei verbindlichen Buchungen',
|
||
effects: ['guest_mail'],
|
||
waits: ['time', 'portal'],
|
||
triggers: ['schedule:reminders'],
|
||
parameters: [ProcessSetting::GuestMessages, ProcessSetting::ArrivalInfoDaysBefore],
|
||
performers: ['system', 'portal', 'service_provider'],
|
||
events: ['document', 'mail'],
|
||
);
|
||
}
|
||
|
||
public function activities(CaseContext $case): array
|
||
{
|
||
$booking = $case->booking;
|
||
$profile = $case->profile;
|
||
|
||
return [$profile->guestMessages() === Responsibility::Portal
|
||
? new Activity('arrival_info', 'Anreise-Informationen an den Gast', ActivityState::External, 'durch '.($booking->processChannel()?->name ?? 'das Portal').' (angekündigt) – eine Zustellung ist damit nicht nachgewiesen')
|
||
: new Activity('arrival_info', 'Anreise-Informationen an den Gast (automatisch)', $case->later($booking->arrival_info_sent_at !== null ? ActivityState::Done : ActivityState::Later), $booking->arrival_info_sent_at ? 'gesendet am '.$booking->arrival_info_sent_at->format('d.m.Y') : $profile->arrivalInfoDaysBefore().' Tage vor Anreise')];
|
||
}
|
||
}
|