Initial Ladill Frontdesk release with deploy pipeline.
Visitor management app with SSO, kiosk, badges, reports, and Gitea CI deploy to frontdesk.ladill.com. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace App\Services\Frontdesk;
|
||||
|
||||
use App\Models\Organization;
|
||||
|
||||
class NotificationPreferenceService
|
||||
{
|
||||
/** @return list<string> */
|
||||
public function channelsForEvent(Organization $organization, string $event): array
|
||||
{
|
||||
if (! $this->isEventEnabled($organization, $event)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return array_values(array_filter(
|
||||
$organization->settings['notification_channels'] ?? ['email'],
|
||||
fn (string $channel) => in_array($channel, array_keys(config('frontdesk.notification_channels', [])), true),
|
||||
));
|
||||
}
|
||||
|
||||
public function isEventEnabled(Organization $organization, string $event): bool
|
||||
{
|
||||
$events = $organization->settings['notification_events']
|
||||
?? config('frontdesk.default_notification_events', []);
|
||||
|
||||
return (bool) ($events[$event] ?? true);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user