<?php

declare(strict_types=1);

namespace App\Module\Directory;

use App\Shared\Domain\Module\ModuleInterface;

final class DirectoryModule implements ModuleInterface
{
    public static function id(): string
    {
        return 'directory';
    }

    public static function label(): string
    {
        return 'Répertoire';
    }

    public static function isRequired(): bool
    {
        return false;
    }

    /**
     * Permissions RBAC fin du Module Directory.
     *
     * Additif : alimente le catalogue RBAC. La sécurité des opérations API
     * reste en ROLE_USER/ROLE_ADMIN (non recâblée ici).
     *
     * @return list<array{code: string, label: string}>
     */
    public static function permissions(): array
    {
        return [
            ['code' => 'directory.clients.view', 'label' => 'Voir les clients'],
            ['code' => 'directory.clients.manage', 'label' => 'Gérer les clients'],
            ['code' => 'directory.prospects.view', 'label' => 'Voir les prospects'],
            ['code' => 'directory.prospects.manage', 'label' => 'Gérer les prospects'],
            ['code' => 'directory.providers.view', 'label' => 'Voir les prestataires'],
            ['code' => 'directory.providers.manage', 'label' => 'Gérer les prestataires'],
        ];
    }
}
