V2.1: nichtlineare Prozessansicht, Begründung der Pflichtschritte, Bedienelemente der neuen Einstellungen
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
f8561fe0e5
commit
fdf226535b
8 files changed
+77
-8
No files matched your search
@@ -4,6 +4,7 @@
|
||||
|
||||
use App\Actions\ConfigureChannelProcess;
|
||||
use App\Enums\AdminMode;
|
||||
use App\Enums\Execution;
|
||||
use App\Enums\IntakeKind;
|
||||
use App\Enums\ProcessSetting;
|
||||
use App\Filament\Resources\Channels\ChannelResource;
|
||||
@@ -175,13 +176,26 @@ public function steps(): array
|
||||
$profile = $this->profile();
|
||||
$draft = $this->drafts[$this->intake];
|
||||
|
||||
return array_map(function (array $row) use ($configuration, $catalogue, $model, $profile): array {
|
||||
$rows = $configuration->preview($this->record, IntakeKind::from($this->intake), $this->draft());
|
||||
$labels = collect($rows)->mapWithKeys(fn (array $row): array => [$row['module'] => $row['label']]);
|
||||
$active = collect($rows)->where('on', true)->pluck('module')->all();
|
||||
|
||||
return array_map(function (array $row) use ($configuration, $catalogue, $model, $profile, $labels, $active): array {
|
||||
$definition = $catalogue->modules()[$row['module']]::definition();
|
||||
// The view of the order is derived from the same definitions the runner uses: only dependencies present in the plan count.
|
||||
$needs = collect($definition->requires)->filter(fn ($dependency): bool => $dependency->hard && in_array($dependency->module, $active, true))->map(fn ($dependency): string => $labels[$dependency->module])->values()->all();
|
||||
$after = collect($definition->requires)->filter(fn ($dependency): bool => ! $dependency->hard && in_array($dependency->module, $active, true))->map(fn ($dependency): string => $labels[$dependency->module])->values()->all();
|
||||
$controls = ChannelProcessConfiguration::STEP_CONTROLS[$row['module']] ?? [];
|
||||
$parameters = array_values(array_filter($controls['parameters'] ?? [], fn (ProcessSetting $setting): bool => in_array(IntakeKind::from($this->intake), $setting->channelIntakes(), true) && ! $model::fixesSetting($setting) && ($this->expert() || in_array($setting, [ProcessSetting::HoldHours, ProcessSetting::DataRequestReminderHours, ProcessSetting::ArrivalInfoDaysBefore, ProcessSetting::ClarificationHoldAutoMinutes], true))));
|
||||
$parameters = array_values(array_filter($controls['parameters'] ?? [], fn (ProcessSetting $setting): bool => in_array(IntakeKind::from($this->intake), $setting->channelIntakes(), true) && ! $model::fixesSetting($setting) && ($this->expert() || in_array($setting, [ProcessSetting::HoldHours, ProcessSetting::DataRequestReminderHours, ProcessSetting::ArrivalInfoDaysBefore, ProcessSetting::ClarificationHoldAutoMinutes, ProcessSetting::ContractDelivery, ProcessSetting::BookingNotice, ProcessSetting::AwaitPortalConfirmation, ProcessSetting::PortalConfirmationWaitHours], true))));
|
||||
|
||||
return [...$row,
|
||||
'purpose' => $definition->purpose,
|
||||
'needs' => $needs,
|
||||
'after' => $after,
|
||||
'condition' => $definition->condition,
|
||||
'why' => $definition->why,
|
||||
'executions' => array_map(fn (Execution $execution): string => $execution->getLabel(), $definition->executions),
|
||||
'triggers' => $definition->triggers,
|
||||
'waits' => $definition->waits,
|
||||
'optional' => $definition->isOptional(),
|
||||
'version' => $catalogue->modules()[$row['module']]::version(),
|
||||
@@ -189,9 +203,9 @@ public function steps(): array
|
||||
'mode_options' => $configuration->modeOptions($row['module']),
|
||||
'performer_setting' => isset($controls['performer']) ? $controls['performer']['setting'] : null,
|
||||
'performer_options' => $configuration->performerOptions($model, $row['module']),
|
||||
'parameters' => array_map(fn (ProcessSetting $setting): array => $this->setting($setting, $profile), $parameters),
|
||||
'parameters' => array_map(fn (ProcessSetting $setting): array => [...$this->setting($setting, $profile), 'options' => $configuration->settingOptions($setting)], $parameters),
|
||||
];
|
||||
}, $configuration->preview($this->record, IntakeKind::from($this->intake), $this->draft()));
|
||||
}, $rows);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -2,7 +2,9 @@
|
||||
|
||||
namespace App\Process;
|
||||
|
||||
use App\Enums\BookingNoticeMode;
|
||||
use App\Enums\ChannelBookingModel;
|
||||
use App\Enums\ContractDelivery;
|
||||
use App\Enums\DataRequestMode;
|
||||
use App\Enums\IntakeKind;
|
||||
use App\Enums\ProcessingMode;
|
||||
@@ -31,7 +33,9 @@ final class ChannelProcessConfiguration
|
||||
'hold' => ['parameters' => [ProcessSetting::ClarificationHoldAutoMinutes, ProcessSetting::ClarificationHoldManualMinutes]],
|
||||
'offer.binding' => ['mode' => ProcessSetting::Processing, 'parameters' => [ProcessSetting::HoldHours, ProcessSetting::ContractTemplate]],
|
||||
'offer.information' => ['mode' => ProcessSetting::Processing, 'parameters' => [ProcessSetting::GuestLinkValidDays]],
|
||||
'documents.send' => ['mode' => ProcessSetting::Processing, 'parameters' => [ProcessSetting::ContractTemplate]],
|
||||
'documents.send' => ['mode' => ProcessSetting::Processing, 'parameters' => [ProcessSetting::ContractDelivery, ProcessSetting::ContractTemplate]],
|
||||
'documents.booking_notice' => ['parameters' => [ProcessSetting::BookingNotice]],
|
||||
'portal.confirmation' => ['parameters' => [ProcessSetting::AwaitPortalConfirmation, ProcessSetting::PortalConfirmationWaitHours]],
|
||||
'arrival.info' => ['performer' => ['field' => 'guest_messages', 'setting' => ProcessSetting::GuestMessages], 'parameters' => [ProcessSetting::ArrivalInfoDaysBefore]],
|
||||
];
|
||||
|
||||
@@ -193,6 +197,21 @@ public function performerOptions(ProcessModel $model, string $module): array
|
||||
->all();
|
||||
}
|
||||
|
||||
/**
|
||||
* The fixed choices of a setting that is not free text (null: free input).
|
||||
*
|
||||
* @return array<string, string>|null
|
||||
*/
|
||||
public function settingOptions(ProcessSetting $setting): ?array
|
||||
{
|
||||
return match ($setting) {
|
||||
ProcessSetting::ContractDelivery => collect(ContractDelivery::cases())->mapWithKeys(fn (ContractDelivery $case): array => [$case->value => $case->getLabel()])->all(),
|
||||
ProcessSetting::BookingNotice => collect(BookingNoticeMode::cases())->mapWithKeys(fn (BookingNoticeMode $case): array => [$case->value => $case->getLabel()])->all(),
|
||||
ProcessSetting::AwaitPortalConfirmation => ['1' => 'ja, erst nach der Bestätigungsmail', '0' => 'nein, sofort'],
|
||||
default => null,
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Allowed modes of a step (as values of its setting).
|
||||
*
|
||||
|
||||
@@ -39,6 +39,7 @@ public static function definition(): ModuleDefinition
|
||||
label: 'Bestätigung des Portals abwarten',
|
||||
purpose: 'Wartet auf die Bestätigungsmail des Portals, bevor Unterlagen und Nachrichten an den Gast gehen. Die Belegung ist von Anfang an gesichert.',
|
||||
phase: 'P02',
|
||||
why: 'Solange das Portal die Buchung nicht bestätigt hat, sollen keine Unterlagen an den Gast gehen; die Belegung ist trotzdem gesichert.',
|
||||
executions: [Execution::Automatic, Execution::Manual, Execution::NotRequired],
|
||||
condition: 'nur bei extern verbindlicher Buchung und nur, wenn für den Kanal „Bestätigungsmail abwarten“ eingestellt ist',
|
||||
requires: [Dependency::hard('intake.record')],
|
||||
|
||||
@@ -33,6 +33,7 @@ public static function definition(): ModuleDefinition
|
||||
label: 'Unverbindliche Auskunft und Buchungswunsch',
|
||||
purpose: 'Beantwortet die Anfrage mit einer unverbindlichen Auskunft ohne Reservierung; fragt der Gast die Buchung an, wird erneut geprüft und verbindlich bestätigt.',
|
||||
phase: 'P02',
|
||||
why: 'Der Gast braucht eine Antwort auf seine Anfrage; ob sie automatisch oder von Hand kommt, bestimmen Sie.',
|
||||
executions: [Execution::Automatic, Execution::Manual],
|
||||
condition: 'bei einer Anfrage ohne Reservierung',
|
||||
requires: [Dependency::hard('intake.record'), Dependency::soft('guest.data_request')],
|
||||
|
||||
@@ -28,6 +28,7 @@ public static function definition(): ModuleDefinition
|
||||
label: 'Anreise-Informationen',
|
||||
purpose: 'Wegbeschreibung, Schlüssel und Kontakt vor Ort rechtzeitig vor der Anreise.',
|
||||
phase: 'P04',
|
||||
why: 'Ohne Anreise-Informationen finden Gäste Schlüssel und Wohnung nicht; wer sie sendet, ist einstellbar.',
|
||||
executions: [Execution::Automatic, Execution::Portal, Execution::ServiceProvider, Execution::NotRequired],
|
||||
condition: 'bei verbindlichen Buchungen',
|
||||
effects: ['guest_mail'],
|
||||
|
||||
Reference in new issue
Block a user