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:
1 parent
e40f8639b3
commit
221ce8ca81
51 files changed
+773
-73
No files matched your search
@@ -6,16 +6,15 @@
|
||||
use App\Enums\ChannelBookingModel;
|
||||
use App\Enums\ContractDelivery;
|
||||
use App\Enums\DataRequestMode;
|
||||
use App\Enums\InquiryAnswer;
|
||||
use App\Enums\IntakeKind;
|
||||
use App\Enums\ProcessingMode;
|
||||
use App\Enums\ProcessSetting;
|
||||
use App\Enums\Responsibility;
|
||||
use App\Models\Channel;
|
||||
use App\Process\Models\ExternalBookingModel;
|
||||
use App\Process\Models\ProcessModel;
|
||||
use App\Process\Models\Responsibilities;
|
||||
use App\Process\Templates\FunctionTemplate;
|
||||
use App\Process\Templates\TemplateArea;
|
||||
use App\Process\Templates\TemplateComposer;
|
||||
|
||||
/**
|
||||
@@ -34,13 +33,14 @@ final class ChannelProcessConfiguration
|
||||
public const STEP_CONTROLS = [
|
||||
'guest.details' => ['parameters' => [ProcessSetting::FormRequiresAddress]],
|
||||
'guest.data_request' => ['mode' => ProcessSetting::DataRequest, 'parameters' => [ProcessSetting::DataRequestReminderHours, ProcessSetting::DataRequestRemindersMax, ProcessSetting::DataRequestFollowupsMax, ProcessSetting::GuestLinkValidDays]],
|
||||
'hold' => ['parameters' => [ProcessSetting::ClarificationHoldAutoMinutes, ProcessSetting::ClarificationHoldManualMinutes]],
|
||||
'hold' => ['parameters' => [ProcessSetting::PreReservation, ProcessSetting::HoldHours, 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::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]],
|
||||
'arrival.info' => ['performer' => ['field' => 'guest_messages', 'setting' => ProcessSetting::ArrivalInfoSender], 'parameters' => [ProcessSetting::ArrivalInfoDaysBefore]],
|
||||
'review.request' => ['performer' => ['field' => 'guest_messages', 'setting' => ProcessSetting::ReviewRequestSender]],
|
||||
];
|
||||
|
||||
public function __construct(private ProcessCatalogue $catalogue, private TemplateComposer $composer) {}
|
||||
@@ -98,7 +98,8 @@ public function modelOptions(Channel $channel, IntakeKind $intake, ?array $capab
|
||||
$capabilities = app(ChannelCapabilities::class)->resolve($channel, $capabilityDraft);
|
||||
$options = [];
|
||||
foreach ($this->catalogue->admissible($intake) as $key => $model) {
|
||||
if ($channel->isWebsite() !== str_starts_with($key, 'a1.')) {
|
||||
// The archetypes of the other way (website: A1, portal: A2) are not offered; the base process fits both.
|
||||
if (($channel->isWebsite() && str_starts_with($key, 'a2.')) || (! $channel->isWebsite() && str_starts_with($key, 'a1.'))) {
|
||||
continue;
|
||||
}
|
||||
$restrictions = [];
|
||||
@@ -152,6 +153,12 @@ public function templateOptions(Channel $channel, ProcessModel $model, ?array $c
|
||||
foreach ($model->slots() as $area) {
|
||||
foreach ($this->catalogue->templates($area) as $key => $class) {
|
||||
$restrictions = $hints = $unconfirmed = [];
|
||||
if (isset($model::templateRestrictions()[$key])) {
|
||||
$restrictions[] = new Restriction(Restriction::BUSINESS, '„'.$class::label().'“ passt nicht zu „'.$model::label().'“: '.$model::templateRestrictions()[$key]);
|
||||
}
|
||||
if ($channel->isWebsite() && in_array(true, $class::capabilityRequirements(), true)) {
|
||||
$restrictions[] = new Restriction(Restriction::BUSINESS, '„'.$class::label().'“ setzt ein Portal voraus; die eigene Webseite hat keines.');
|
||||
}
|
||||
foreach ($class::capabilityRequirements() as $capability => $required) {
|
||||
$actual = $capabilities[$capability] ?? null;
|
||||
$definition = ChannelCapabilities::definitions()[$capability];
|
||||
@@ -197,7 +204,9 @@ public function currentTemplates(Channel $channel, IntakeKind $intake): array
|
||||
return $this->composer->resolve($model, $current['templates']);
|
||||
}
|
||||
|
||||
return $model::presetTemplates() === [] ? [] : $this->composer->resolve($this->catalogue->model(ExternalBookingModel::key()), $model::presetTemplates());
|
||||
$base = $model::composedBy();
|
||||
|
||||
return $base === null || $model::presetTemplates() === [] ? [] : $this->composer->resolve($this->catalogue->model($base), $model::presetTemplates());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -382,11 +391,11 @@ public function preview(Channel $channel, IntakeKind $intake, array $draft): arr
|
||||
$on = ($draft['steps'][$key]['on'] ?? true) !== false || ! $definition->isOptional();
|
||||
$reason = match (true) {
|
||||
! $on => 'im Kanal abgeschaltet',
|
||||
$key === 'hold' && ! $profile->preReservation() => 'keine Vorreservierung in diesem Modell',
|
||||
$key === 'offer.information' && $profile->preReservation() => 'nicht in diesem Modell (verbindliches Angebot)',
|
||||
$key === 'offer.binding' && ! $profile->preReservation() => 'erst, wenn ein Angebot von Hand gesendet wird',
|
||||
$key === 'hold' && ! $profile->preReservation() => 'keine Reservierung bei der Anfrage',
|
||||
$key === 'offer.information' && $profile->inquiryAnswer() === InquiryAnswer::Offer => 'nicht bei verbindlichem Angebot',
|
||||
$key === 'offer.binding' && $profile->inquiryAnswer() === InquiryAnswer::Information => 'erst, wenn ein Angebot von Hand gesendet wird',
|
||||
$key === 'portal.payout' && $profile->payments() !== Responsibility::Portal => 'wir kassieren selbst',
|
||||
$key === 'review.request' && $profile->guestMessages() !== Responsibility::Landlord => 'das Portal schreibt dem Gast',
|
||||
$key === 'review.request' && $profile->reviewRequestSender() !== Responsibility::Landlord => 'die Bewertungsbitte kommt nicht von uns',
|
||||
$key === 'guest.details' && $intake === IntakeKind::Booking && $profile->documents() === Responsibility::Portal && $profile->payments() === Responsibility::Portal && $profile->guestMessages() === Responsibility::Portal => 'wir schreiben dem Gast nicht',
|
||||
default => null,
|
||||
};
|
||||
@@ -394,7 +403,8 @@ public function preview(Channel $channel, IntakeKind $intake, array $draft): arr
|
||||
$performer = match ($key) {
|
||||
'documents.send' => $profile->documents()->value,
|
||||
'payments.monitor' => $profile->payments()->value,
|
||||
'arrival.info' => $profile->guestMessages()->value,
|
||||
'arrival.info' => $profile->arrivalInfoSender()->value,
|
||||
'review.request' => $profile->reviewRequestSender()->value,
|
||||
default => $definition->performers[0] ?? null,
|
||||
};
|
||||
$rows[] = ['module' => $key, 'label' => $definition->label, 'phase' => $definition->phase, 'on' => $on && $reason === null, 'reason' => $reason,
|
||||
@@ -486,10 +496,13 @@ private function templateProblems(Channel $channel, ProcessModel $model, array $
|
||||
foreach ($options[$area][$class::key()]['restrictions'] ?? [] as $restriction) {
|
||||
$problems[] = $restriction->text();
|
||||
}
|
||||
$setting = TemplateArea::from($area)->setting();
|
||||
$value = $setting->normalize($draft['settings'][$setting->value] ?? null);
|
||||
if ($value !== null && (string) $value !== $class::responsibility()->value) {
|
||||
$problems[] = $setting->question().' „'.$setting->describe($value).'“ widerspricht der Schablone „'.$class::label().'“ ('.$setting->describe($class::responsibility()->value).').';
|
||||
foreach ($class::fixes() as $key => $fixed) {
|
||||
$setting = ProcessSetting::tryFrom($key);
|
||||
$value = $setting?->normalize($draft['settings'][$key] ?? null);
|
||||
$fixedValue = $setting?->normalize($fixed) ?? $fixed;
|
||||
if ($setting !== null && $value !== null && (string) $value !== (string) $fixedValue) {
|
||||
$problems[] = $setting->question().' „'.$setting->describe($value).'“ widerspricht der Schablone „'.$class::label().'“ ('.$setting->describe($fixedValue).').';
|
||||
}
|
||||
}
|
||||
}
|
||||
$messages = app(ChannelCapabilities::class)->resolve($channel, $capabilities)[ChannelCapabilities::MESSAGES_GUEST] ?? null;
|
||||
|
||||
Reference in new issue
Block a user