- Connector-System (app/Channels, config/channels.php) mit iCal-Connector, robustem Parser und Export-Feed je Portal (ohne eigene Belegungen, ohne Gästedaten) - Abgleich alle 5 Min. mit Protokoll, Echo-Erkennung, Konflikt-Mail bei möglicher Doppelbuchung - Überwachung: Störungs-Mail, Status-Endpunkt /health/sync für n8n - Portal-Aufgaben für Sofortbuchungsportale (FeWo-direkt): automatisch aus Buchungen/Sperren/anderen Portalen, Mail + Erinnerung, Abhaken im Admin - Optionaler signierter Automatisierungs-Webhook mit Rückmeldung - Herkunftsmessung: Abfrage im Formular + UTM-Parameter - Portal-Analyse: AGB-Prüfung Automatisierung, Umsetzungsbeschreibung Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
38 lines
909 B
PHP
38 lines
909 B
PHP
<?php
|
|
|
|
namespace App\Channels;
|
|
|
|
use App\Channels\Contracts\ChannelConnector;
|
|
use InvalidArgumentException;
|
|
|
|
/**
|
|
* Resolves the connectors registered in config/channels.php.
|
|
*/
|
|
class ChannelRegistry
|
|
{
|
|
/**
|
|
* @return array<string, class-string<ChannelConnector>>
|
|
*/
|
|
public function connectors(): array
|
|
{
|
|
return collect(config('channels.connectors'))
|
|
->mapWithKeys(fn (string $class): array => [$class::key() => $class])
|
|
->all();
|
|
}
|
|
|
|
public function resolve(string $key): ChannelConnector
|
|
{
|
|
$class = $this->connectors()[$key] ?? throw new InvalidArgumentException("Unknown channel connector [{$key}].");
|
|
|
|
return app($class);
|
|
}
|
|
|
|
/**
|
|
* @return array<string, string>
|
|
*/
|
|
public function options(): array
|
|
{
|
|
return array_map(fn (string $class): string => $class::label(), $this->connectors());
|
|
}
|
|
}
|