'Portal-Abgleich (iCal)', self::PortalMail => 'Portal-Postfach (Schnellweg)', self::AiOffers => 'KI: Angebotsentwürfe', self::AiMarketing => 'KI: Vermarktungsassistent', self::AiGuestMail => 'KI: Gästekommunikation', }; } public function description(): string { return match ($this) { self::PortalSync => 'Belegungen der Portale über iCal einlesen und den eigenen Kalender als Feed anbieten.', self::PortalMail => 'Buchungsmails der Portale aus dem Postfach lesen und Termine sofort sperren.', self::AiGuestMail => 'Antworten und Nachrichten der Gäste auswerten: erkannte Angaben (Anschrift, Telefon …) werden vorgeschlagen und nur nach festen Regeln übernommen; nichts Verbindliches entscheidet die KI.', self::AiOffers, self::AiMarketing => 'Noch nicht gebaut.', }; } /** * Whether the application asks this switch before it acts. Only wired services are offered for switching. */ public function isWired(): bool { return match ($this) { self::PortalSync, self::PortalMail, self::AiGuestMail => true, self::AiOffers, self::AiMarketing => false, }; } /** * What applies to a landlord the operator has not decided about yet. The portal services were part of * the product before there were landlords, so switching tenancy on must not silently stop them. */ public function enabledByDefault(): bool { // The AI service sends guests' messages to an external provider: only after the operator switched it on. return $this->isWired() && $this !== self::AiGuestMail; } /** * Whether the landlord's own API key is of any use (the guest communication extraction calls out). */ public function usesApiKey(): bool { return match ($this) { self::AiOffers, self::AiMarketing, self::AiGuestMail => true, self::PortalSync, self::PortalMail => false, }; } /** * @return list */ public static function wired(): array { return array_values(array_filter(self::cases(), fn (self $service): bool => $service->isWired())); } }