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

+52 -5
View File
@@ -24,20 +24,26 @@
use Illuminate\Support\Str;
/**
* A sales channel (portal) of a property. Our system leads: occupations are imported from the
* channel and every channel gets its own export feed without its own occupations.
* A sales channel of a property. A portal (kind "portal"): our system leads, occupations are imported from the
* channel and every channel gets its own export feed without its own occupations. The own website (kind "website",
* v0.11 channel manager) only carries the settings for requests from the website: it is never synchronised,
* exported, monitored or given blocking tasks, and cases from the website stay direct (A1) without a channel.
*/
#[Fillable(['property_id', 'name', 'connector', 'settings', 'is_active', 'requires_manual_blocking', 'manage_url', 'status', 'booking_model', 'import_enabled', 'export_enabled', 'export_mode', 'external_poll_minutes', 'echo_behavior', 'echo_notes', 'operating_notes', 'portal_verified_at', 'payment_tasks_inquiry', 'payment_tasks_reservation', 'contract_template_id', 'contract_template_reservation_id', 'process_overrides', 'case_intake'])]
#[Fillable(['property_id', 'name', 'connector', 'settings', 'is_active', 'requires_manual_blocking', 'manage_url', 'status', 'booking_model', 'import_enabled', 'export_enabled', 'export_mode', 'external_poll_minutes', 'echo_behavior', 'echo_notes', 'operating_notes', 'portal_verified_at', 'payment_tasks_inquiry', 'payment_tasks_reservation', 'contract_template_id', 'contract_template_reservation_id', 'process_overrides', 'case_intake', 'kind'])]
#[Hidden(['export_token', 'previous_export_token', 'export_snapshot', 'settings', 'ical_analysis'])]
class Channel extends Model
{
/** @use HasFactory<ChannelFactory> */
use BelongsToTenant, HasFactory;
public const KIND_PORTAL = 'portal';
public const KIND_WEBSITE = 'website';
protected $attributes = [
'status' => 'setup', 'booking_model' => 'mixed', 'import_enabled' => false,
'export_enabled' => false, 'export_mode' => 'test',
'echo_behavior' => 'unverified', 'case_intake' => 'off',
'echo_behavior' => 'unverified', 'case_intake' => 'off', 'kind' => self::KIND_PORTAL,
];
protected static function booted(): void
@@ -138,7 +144,48 @@ public function tasks(): HasMany
#[Scope]
protected function active(Builder $query): Builder
{
return $query->where('is_active', true)->where('status', ChannelStatus::Active);
return $query->where('is_active', true)->where('status', ChannelStatus::Active)->where('kind', self::KIND_PORTAL);
}
/**
* Portals only (active or not) – everything except the own website's settings entry.
*
* @param Builder<Channel> $query
* @return Builder<Channel>
*/
#[Scope]
protected function portals(Builder $query): Builder
{
return $query->where('kind', self::KIND_PORTAL);
}
public function isWebsite(): bool
{
return $this->kind === self::KIND_WEBSITE;
}
public function isPortal(): bool
{
return ! $this->isWebsite();
}
/**
* The settings entry of the property's own website, created on first use.
*/
public static function websiteOf(Property $property): self
{
return self::withoutGlobalScopes()->firstOrCreate(
['property_id' => $property->id, 'kind' => self::KIND_WEBSITE],
['tenant_id' => $property->tenant_id, 'name' => 'Eigene Webseite', 'connector' => self::KIND_WEBSITE, 'status' => ChannelStatus::Active, 'booking_model' => ChannelBookingModel::Inquiry],
);
}
/**
* The settings entry of the property's own website if there is one (no write, for resolving settings).
*/
public static function existingWebsiteOf(Property $property): ?self
{
return self::withoutGlobalScopes()->where('property_id', $property->id)->where('kind', self::KIND_WEBSITE)->first();
}
public function connector(): ChannelConnector