v0.11 U1: Kanalmanager mit eigener Webseite und neuen Prozessparametern

- Eigene Webseite als Kanal eigener Art (channels.kind = website), nur zur
  Konfiguration: Webseiten-Anfragen bleiben direkt (A1) ohne Kanalbezug;
  der Eintrag nimmt an Sync, Export, Überwachung und Sperraufgaben nicht teil
  (active()/Property::channels() nur Portale, Feed nur für Portale).
- Neue Einstellungen im bestehenden ProcessSetting: Klärungsreservierung
  automatisch/Freigabe (15/180 min, 0 = keine), Rückfragemodus,
  Erinnerungen, Folgefragen, Erinnerungsabstand, Linkgültigkeit,
  Anschrift im Webformular verlangen (Standard: nein).
- „Kanäle“ in der einfachen Ansicht: Webseite und Portale an einer Stelle,
  Verweis auf „Ihre Standards“; „Wirksame Einstellungen“ mit Spalte
  „Eigene Webseite“ und Herkunft „Webseite“.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
LarsandClaude Opus 5.5 committed 2026-11-03 12:52:50 +01:00
1 parent bfccfe7eed
commit 799869c6a4
27 files changed
+559 -106

No files matched your search

+46
View File
@@ -3,6 +3,7 @@
namespace App\Process;
use App\Enums\CaseType;
use App\Enums\DataRequestMode;
use App\Enums\IntakeKind;
use App\Enums\ProcessingMode;
use App\Enums\ProcessSetting;
@@ -23,6 +24,9 @@ final class ProcessProfile
public const CHANNEL = 'channel';
/** The own website's entry of the channel manager (v0.11). */
public const WEBSITE = 'website';
/** Fixed by the case type (A6), not settable. */
public const CASE_TYPE = 'case_type';
@@ -104,6 +108,47 @@ public function arrivalInfoDaysBefore(): int
return max(1, (int) $this->value(ProcessSetting::ArrivalInfoDaysBefore));
}
public function dataRequestMode(): DataRequestMode
{
return DataRequestMode::tryFrom((string) $this->value(ProcessSetting::DataRequest)) ?? DataRequestMode::Approval;
}
/**
* Minutes of the clarification hold of an incomplete request (E-033): the value for automatic requests when the
* guest is asked automatically, otherwise the one for release or manual requests. 0 = no hold.
*/
public function clarificationHoldMinutes(): int
{
$setting = $this->dataRequestMode() === DataRequestMode::Automatic ? ProcessSetting::ClarificationHoldAutoMinutes : ProcessSetting::ClarificationHoldManualMinutes;
return max(0, (int) $this->value($setting));
}
public function remindersMax(): int
{
return max(0, (int) $this->value(ProcessSetting::DataRequestRemindersMax));
}
public function followupsMax(): int
{
return max(0, (int) $this->value(ProcessSetting::DataRequestFollowupsMax));
}
public function reminderHours(): int
{
return max(1, (int) $this->value(ProcessSetting::DataRequestReminderHours));
}
public function guestLinkValidDays(): int
{
return max(1, (int) $this->value(ProcessSetting::GuestLinkValidDays));
}
public function formRequiresAddress(): bool
{
return (bool) $this->value(ProcessSetting::FormRequiresAddress);
}
public function contractTemplateId(): ?int
{
$value = $this->value(ProcessSetting::ContractTemplate);
@@ -120,6 +165,7 @@ public static function sourceLabel(string $source): string
self::TENANT => 'Ihre Standardeinstellung',
self::PROPERTY => 'Abweichung der Wohnung',
self::CHANNEL => 'Abweichung des Portals',
self::WEBSITE => 'Einstellung der eigenen Webseite',
self::CASE_TYPE => 'fest für diese Vorgangsart',
'migration' => 'aus dem bisherigen Stand übernommen',
default => 'Grundeinstellung',
+16 -5
View File
@@ -28,7 +28,7 @@ public function resolve(Property $property, ?Channel $channel, IntakeKind $intak
$levels = [
ProcessProfile::TENANT => $this->tenantDefaults($property->tenant_id),
ProcessProfile::PROPERTY => $propertyLevel,
ProcessProfile::CHANNEL => $intake === IntakeKind::Internal || $channel === null ? [] : (array) (($channel->process_overrides ?? [])[$intake->value] ?? []),
($channel?->isWebsite() ? ProcessProfile::WEBSITE : ProcessProfile::CHANNEL) => $intake === IntakeKind::Internal || $channel === null ? [] : (array) (($channel->process_overrides ?? [])[$intake->value] ?? []),
];
$values = [];
@@ -38,7 +38,7 @@ public function resolve(Property $property, ?Channel $channel, IntakeKind $intak
$sources[$setting->value] = ProcessProfile::SYSTEM;
foreach ($levels as $level => $settings) {
if ($level === ProcessProfile::CHANNEL && ! in_array($intake, $setting->channelIntakes(), true)) {
if (in_array($level, [ProcessProfile::CHANNEL, ProcessProfile::WEBSITE], true) && ! in_array($intake, $setting->channelIntakes(), true)) {
continue;
}
$value = $setting->normalize($settings[$setting->value] ?? null);
@@ -65,7 +65,16 @@ public function resolve(Property $property, ?Channel $channel, IntakeKind $intak
$documents = Responsibility::from((string) $values[ProcessSetting::Documents->value]);
$payments = Responsibility::from((string) $values[ProcessSetting::Payments->value]);
return new ProcessProfile($intake, ProcessProfile::caseTypeFor($intake, $channel !== null, $documents, $payments), $values, $sources);
return new ProcessProfile($intake, ProcessProfile::caseTypeFor($intake, $channel?->isPortal() ?? false, $documents, $payments), $values, $sources);
}
/**
* Settings of a request from the own website: the website's entry of the channel manager is its channel level
* (the case itself stays direct, without a channel).
*/
public function forWebsite(Property $property, IntakeKind $intake = IntakeKind::Inquiry): ProcessProfile
{
return $this->resolve($property, Channel::existingWebsiteOf($property), $intake);
}
/**
@@ -76,7 +85,9 @@ public function forBooking(Booking $booking): ProcessProfile
// The case's own landlord counts, whichever landlord is current (e.g. a case written by the system).
$property = $booking->property ?? Property::withoutGlobalScope('tenant')->findOrFail($booking->property_id);
return $this->resolve($property, $booking->processChannel(), $booking->intake ?? self::intakeFor($booking));
$channel = $booking->processChannel() ?? ($booking->source === 'website' ? Channel::existingWebsiteOf($property) : null);
return $this->resolve($property, $channel, $booking->intake ?? self::intakeFor($booking));
}
/**
@@ -100,7 +111,7 @@ public function tenantDefaults(?int $tenantId): array
public static function intakeFor(Booking $booking): IntakeKind
{
$channel = $booking->processChannel();
if ($channel === null) {
if ($channel === null || $channel->isWebsite()) {
return IntakeKind::Inquiry;
}