<?php

namespace App\Model;

final class UserGroupPermissions
{
    public const string ROLE_SUPER_ADMIN = 'ROLE_SUPER_ADMIN';
    public const string ROLE_ORGANIZATIONAL_UNIT_ADMIN = 'ROLE_ORGANIZATIONAL_UNIT_ADMIN';
    public const string ROLE_ORGANIZATIONAL_UNIT_OPERATOR = 'ROLE_ORGANIZATIONAL_UNIT_OPERATOR';
    public const string ROLE_ORGANIZATIONAL_UNIT_MINIMAL = 'ROLE_ORGANIZATIONAL_UNIT_MINIMAL';
    public const string ROLE_USER = 'ROLE_USER';

    private const array ROLE_NAMES = [
        self::ROLE_SUPER_ADMIN => 'Super Admin',
        self::ROLE_ORGANIZATIONAL_UNIT_ADMIN => 'Admin de aulas',
        self::ROLE_ORGANIZATIONAL_UNIT_OPERATOR => 'Operador de aulas',
        self::ROLE_ORGANIZATIONAL_UNIT_MINIMAL => 'Usuario básico de aulas',
        self::ROLE_USER => 'Usuario',
    ];

    public static function getRoleNames(): array
    {
        return self::ROLE_NAMES;
    }

    public static function getRoleName(string $role): ?string
    {
        return self::ROLE_NAMES[$role] ?? null;
    }

    public static function getRoles(): array
    {
        return array_keys(self::ROLE_NAMES);
    }
}