Konfigurator: Ablauf im Zusammenhang aus dem Plan, Nachrichtenregeln, einheitliche Anfrage-/Buchungsansicht; Abnahmetests
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
221ce8ca81
commit
b1b09a6db4
7 files changed
+616
-36
No files matched your search
@@ -3,9 +3,13 @@
|
||||
namespace App\Filament\Resources\Channels\Pages;
|
||||
|
||||
use App\Actions\ConfigureChannelProcess;
|
||||
use App\Communication\CommunicationRules;
|
||||
use App\Enums\AdminMode;
|
||||
use App\Enums\Execution;
|
||||
use App\Enums\IntakeKind;
|
||||
use App\Enums\Medium;
|
||||
use App\Enums\MessageEffect;
|
||||
use App\Enums\MessageIntent;
|
||||
use App\Enums\ProcessSetting;
|
||||
use App\Filament\Resources\Channels\ChannelResource;
|
||||
use App\Models\Booking;
|
||||
@@ -17,6 +21,7 @@
|
||||
use App\Process\ConfigurationImpact;
|
||||
use App\Process\Models\ProcessModel;
|
||||
use App\Process\ProcessCatalogue;
|
||||
use App\Process\ProcessLanes;
|
||||
use App\Process\ProcessProfile;
|
||||
use App\Process\ProcessSettings;
|
||||
use App\Process\Restriction;
|
||||
@@ -254,6 +259,50 @@ public function applyPreset(string $archetype): void
|
||||
$this->drafts[$this->intake]['steps'] = array_intersect_key($this->drafts[$this->intake]['steps'], array_flip($base->modules('standard', $presets[$archetype]['templates'])));
|
||||
}
|
||||
|
||||
/**
|
||||
* The course as the runner executes it: parallel, waiting (with what for), event-driven, time-driven, not applying.
|
||||
*
|
||||
* @return array<string, list<array<string, mixed>>>
|
||||
*/
|
||||
public function lanes(): array
|
||||
{
|
||||
return app(ProcessLanes::class)->of($this->steps());
|
||||
}
|
||||
|
||||
/**
|
||||
* What arrives here and how binding it is (the start of the course).
|
||||
*
|
||||
* @return array{event: string, binding: string, media: list<string>}
|
||||
*/
|
||||
public function entry(): array
|
||||
{
|
||||
$rules = app(CommunicationRules::class);
|
||||
$media = array_values(array_map(fn (Medium $medium): string => $medium->getLabel(), array_filter(Medium::cases(), fn (Medium $medium): bool => $rules->mediumActive($medium))));
|
||||
$booking = $this->intake === IntakeKind::Booking->value;
|
||||
|
||||
return [
|
||||
'event' => $booking ? 'Eine feste Buchung kommt über '.$this->record->name.' an (Portalmail, Kalender).' : ($this->record->isWebsite() ? 'Ein Gast fragt über die Webseite einen Aufenthalt an.' : 'Eine Anfrage kommt über '.$this->record->name.' an.'),
|
||||
'binding' => $booking ? 'Beim Portal bereits verbindlich – wir übernehmen, wir verbinden nichts neu.' : 'Unverbindlich – verbindlich wird sie durch unser Angebot und die Annahme des Gastes.',
|
||||
'media' => $media,
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* What a message does here, by its intent – the rules (not a process): a general question creates no case.
|
||||
*
|
||||
* @return list<array{intent: string, effects: list<string>, creates_case: bool}>
|
||||
*/
|
||||
public function messageRules(): array
|
||||
{
|
||||
$rules = app(CommunicationRules::class);
|
||||
|
||||
return array_map(fn (MessageIntent $intent): array => [
|
||||
'intent' => $intent->getLabel(),
|
||||
'effects' => array_map(fn (MessageEffect $effect): string => $effect->getLabel(), $rules->effects(Medium::Email, $intent)),
|
||||
'creates_case' => false,
|
||||
], MessageIntent::cases());
|
||||
}
|
||||
|
||||
/**
|
||||
* What the draft's change of templates means (modules, responsibilities, stored switches and settings).
|
||||
*
|
||||
|
||||
Reference in new issue
Block a user