Anfrage-Basisprozess inquiry.request mit Schablonen für Antwort und Gastkommunikation

Antwortart (Auskunft/Angebot) und Reservierung sind entkoppelt (neue Einstellung inquiry_answer;
pre_reservation bleibt die Reservierungsstrategie). Anlass-bezogene Absender für Anreise-Information
und Bewertungsbitte; Schablonen liefern Standardwerte unterhalb aller einstellbaren Ebenen.
A1/A2 bleiben Voreinstellungen und Altfassungen.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
LarsandClaude Sonnet 5.5 committed 2026-11-05 12:40:22 +01:00
1 parent e40f8639b3
commit 221ce8ca81
51 files changed
+773 -73

No files matched your search

+27 -3
View File
@@ -3,6 +3,7 @@
namespace App\Process;
use App\Enums\ChannelBookingModel;
use App\Enums\InquiryAnswer;
use App\Enums\IntakeKind;
use App\Enums\ProcessSetting;
use App\Enums\Responsibility;
@@ -34,11 +35,23 @@ public function resolve(Property $property, ?Channel $channel, IntakeKind $intak
($channel?->isWebsite() ? ProcessProfile::WEBSITE : ProcessProfile::CHANNEL) => $intake === IntakeKind::Internal || $channel === null ? [] : (array) (($channel->process_overrides ?? [])[$intake->value] ?? []),
];
$model = $this->chosenModel($channel, $intake);
$templates = $this->chosenTemplates($channel, $intake, $model);
$suggested = [];
foreach ($templates as $class) {
$suggested = [...$suggested, ...$class::defaults()];
}
$values = [];
$sources = [];
foreach (ProcessSetting::cases() as $setting) {
$values[$setting->value] = $setting->default();
$sources[$setting->value] = ProcessProfile::SYSTEM;
// A function template only suggests: below every level the landlord can set.
if (($suggestion = $setting->normalize($suggested[$setting->value] ?? null)) !== null) {
$values[$setting->value] = $suggestion;
$sources[$setting->value] = ProcessProfile::TEMPLATE_DEFAULT;
}
foreach ($levels as $level => $settings) {
if (in_array($level, [ProcessProfile::CHANNEL, ProcessProfile::WEBSITE], true) && ! in_array($intake, $setting->channelIntakes(), true)) {
@@ -54,7 +67,6 @@ public function resolve(Property $property, ?Channel $channel, IntakeKind $intak
// Architektur V2: the process model chosen for the channel and intake kind fixes some settings (e.g. the
// pre-reservation of the offer model, the responsibilities of A3–A5); these win over every level.
$model = $this->chosenModel($channel, $intake);
foreach ($model === null ? [] : $model::fixes() as $key => $fixed) {
$setting = ProcessSetting::tryFrom($key);
if ($setting !== null) {
@@ -64,9 +76,9 @@ public function resolve(Property $property, ?Channel $channel, IntakeKind $intak
}
// Function templates chosen for the model's slots fix the responsibility of their area.
foreach ($this->chosenTemplates($channel, $intake, $model) as $class) {
foreach ($templates as $class) {
foreach ($class::fixes() as $key => $fixed) {
$values[$key] = $fixed;
$values[$key] = ProcessSetting::tryFrom($key)?->normalize($fixed) ?? $fixed;
$sources[$key] = ProcessProfile::TEMPLATE;
}
}
@@ -84,6 +96,18 @@ public function resolve(Property $property, ?Channel $channel, IntakeKind $intak
$sources[ProcessSetting::Documents->value] = ProcessProfile::SYSTEM;
}
// What was set nowhere follows the related setting, as it always did.
foreach ([ProcessSetting::ArrivalInfoSender, ProcessSetting::ReviewRequestSender] as $sender) {
if ($values[$sender->value] === null && $intake !== IntakeKind::Internal) {
$values[$sender->value] = $values[ProcessSetting::GuestMessages->value];
$sources[$sender->value] = ProcessProfile::DERIVED;
}
}
if ($values[ProcessSetting::InquiryAnswer->value] === null && $intake === IntakeKind::Inquiry) {
$values[ProcessSetting::InquiryAnswer->value] = $values[ProcessSetting::PreReservation->value] ? InquiryAnswer::Offer->value : InquiryAnswer::Information->value;
$sources[ProcessSetting::InquiryAnswer->value] = ProcessProfile::DERIVED;
}
$documents = Responsibility::from((string) $values[ProcessSetting::Documents->value]);
$payments = Responsibility::from((string) $values[ProcessSetting::Payments->value]);