<?php

namespace Modules\Identity;

use Filament\Contracts\Plugin;
use Filament\Panel;

/**
 * Thin Access-management plugin (see tickets.md T1.3) — Identity has no
 * customer-facing CRUD of its own, just the read-only AuditLogResource
 * (T6.2) discovered here.
 */
class IdentityPlugin implements Plugin
{
    public function getId(): string
    {
        return 'identity';
    }

    public function register(Panel $panel): void
    {
        $panel
            ->discoverResources(
                in: __DIR__.'/Filament/Resources',
                for: 'Modules\Identity\Filament\Resources',
            )
            ->discoverPages(
                in: __DIR__.'/Filament/Pages',
                for: 'Modules\Identity\Filament\Pages',
            )
            ->discoverWidgets(
                in: __DIR__.'/Filament/Widgets',
                for: 'Modules\Identity\Filament\Widgets',
            );
    }

    public function boot(Panel $panel): void {}

    public static function make(): static
    {
        return app(static::class);
    }
}
