<?php

namespace App\Enums;

enum PermissionModules: string
{
    case USERS = 'users';
    case ROLES = 'roles';
    case SETTINGS = 'settings';
    case REPORTS = 'reports';
    case DASHBOARD = 'dashboard';

    public function label(): string
    {
        return match($this) {
            self::USERS => 'المستخدمين',
            self::ROLES => 'الأدوار',
            self::SETTINGS => 'الإعدادات',
            self::REPORTS => 'التقارير',
            self::DASHBOARD => 'لوحة التحكم',
        };
    }

    public function actions(): array
    {
        return match($this) {
            self::USERS => ['view', 'create', 'edit', 'delete', 'export'],
            self::ROLES => ['view', 'create', 'edit', 'delete'],
            self::SETTINGS => ['view', 'edit'],
            self::REPORTS => ['view', 'generate', 'export'],
            self::DASHBOARD => ['view', 'manage'],
        };
    }
}
