'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::AiOffers, self::AiMarketing, self::AiGuestMail => '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 => true, self::AiOffers, self::AiMarketing, self::AiGuestMail => 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 { return $this->isWired(); } /** * Whether the landlord's own API key is of any use. Nothing calls out yet, so no service has one. */ 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())); } }