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>
48 lines
1.7 KiB
PHP
48 lines
1.7 KiB
PHP
<?php
|
||
|
||
namespace App\Process\Modules\Intake;
|
||
|
||
use App\Enums\ActivityState;
|
||
use App\Enums\Execution;
|
||
use App\Process\Activity;
|
||
use App\Process\CaseContext;
|
||
use App\Process\Modules\Module;
|
||
use App\Process\Modules\ModuleDefinition;
|
||
|
||
/**
|
||
* P01: the case came in – request, portal booking or internal occasion. Recording it (and the hold of a request,
|
||
* under the calendar lock) is done by the intake actions; the step only shows it.
|
||
*/
|
||
final class IntakeRecord extends Module
|
||
{
|
||
public static function key(): string
|
||
{
|
||
return 'intake.record';
|
||
}
|
||
|
||
public static function definition(): ModuleDefinition
|
||
{
|
||
return new ModuleDefinition(
|
||
label: 'Eingang',
|
||
purpose: 'Hält den Eingang der Anfrage, Buchung oder Eigenbelegung fest und friert den Ablauf ein.',
|
||
phase: 'P01',
|
||
executions: [Execution::Automatic],
|
||
condition: 'immer, sobald ein Vorgang entsteht',
|
||
why: 'Ohne Eingang gibt es keinen Vorgang.',
|
||
effects: ['case_write', 'calendar_hold'],
|
||
triggers: ['intake'],
|
||
events: ['created', 'intake', 'profile', 'hold', 'mode'],
|
||
);
|
||
}
|
||
|
||
public function activities(CaseContext $case): array
|
||
{
|
||
$booking = $case->booking;
|
||
if ($booking->isInternal()) {
|
||
return [new Activity('intake', ($booking->internal_kind?->getLabel() ?? 'Eigene Belegung').' eingetragen', ActivityState::Done, $booking->occasion)];
|
||
}
|
||
|
||
return [new Activity('intake', $case->inquiry ? 'Anfrage eingegangen' : 'Buchung beim Portal eingegangen', ActivityState::Done, $booking->created_at?->format('d.m.Y').' · '.$booking->bookingChannelLabel())];
|
||
}
|
||
}
|