<?php

namespace App\Constants;

class Permissions
{
    // Section: System
    public const SECTION_SYSTEM = 'system_section';

    public const DASHBOARD_VIEW = 'dashboard_view';

    public const ACTIVITY_LOG = 'activity_log';

    // Section: Account
    public const SECTION_ACCOUNT = 'account_section';

    public const MEMBER_DIRECTORY = 'member_directory';

    public const ACCESS_ROLES = 'access_roles';

    // Section: Business
    public const SECTION_BUSINESS = 'business_settings';

    public const BUSINESS_BRANDING = 'business_branding';

    public const LEGAL_MANAGEMENT = 'legal_management';

    public const BUSINESS_LOGIC = 'business_logic';

    public const PAYMENT_SETTINGS = 'payment_settings';

    public const BRANDING_SETTINGS = 'branding_settings';

    // Section: LMS
    public const SECTION_LMS = 'lms_section';

    public const COURSE_MANAGEMENT = 'course_management';

    public const CATEGORY_MANAGEMENT = 'category_management';

    public const ENROLLMENT_MANAGEMENT = 'enrollment_management';

    public const LIVE_CLASS_MANAGEMENT = 'live_class_management';

    public const REVIEW_MODERATION = 'review_moderation';

    public const CERTIFICATE_MANAGEMENT = 'certificate_management';

    public const ASSIGNMENT_MANAGEMENT = 'assignment_management';

    public const ORDER_MANAGEMENT = 'order_management';

    public const ANNOUNCEMENT_MANAGEMENT = 'announcement_management';

    public static function getAll(): array
    {
        return [
            self::SECTION_SYSTEM => [
                'label' => 'System',
                'icon' => 'LayoutDashboard',
                'sub_modules' => [
                    self::DASHBOARD_VIEW => [
                        'label' => 'Dashboard',
                        'description' => 'View system health and metrics',
                        'route' => 'admin.dashboard',
                        'icon' => 'Activity',
                    ],
                ],
            ],
            'products_section' => [
                'label' => 'Products (Stock)',
                'icon' => 'Package',
                'sub_modules' => [
                    'product_management' => [
                        'label' => 'Products',
                        'description' => 'Manage products and stock',
                        'route' => 'admin.products.index',
                        'icon' => 'Package',
                    ],
                ],
            ],
            'sales_section' => [
                'label' => 'Sales',
                'icon' => 'DollarSign',
                'sub_modules' => [
                    'sales_management' => [
                        'label' => 'Sales',
                        'description' => 'Record and view sales',
                        'route' => 'admin.sales.index',
                        'icon' => 'DollarSign',
                    ],
                ],
            ],
            'repairs_section' => [
                'label' => 'Repair / Unlock (मर्मत)',
                'icon' => 'Wrench',
                'sub_modules' => [
                    'repair_management' => [
                        'label' => 'Repairs',
                        'description' => 'Manage repair and unlock services',
                        'route' => 'admin.repairs.index',
                        'icon' => 'Wrench',
                    ],
                ],
            ],
            'second_hand_section' => [
                'label' => 'Second-hand Buy',
                'icon' => 'ShoppingCart',
                'sub_modules' => [
                    'second_hand_management' => [
                        'label' => 'Second-hand Buys',
                        'description' => 'Manage second-hand mobile purchases',
                        'route' => 'admin.second-hand-buys.index',
                        'icon' => 'ShoppingCart',
                    ],
                ],
            ],
            'tools_section' => [
                'label' => 'Tools (Buy / Rent)',
                'icon' => 'Hammer',
                'sub_modules' => [
                    'tool_management' => [
                        'label' => 'Tools',
                        'description' => 'Manage unlocking tools buy/rent',
                        'route' => 'admin.tools.index',
                        'icon' => 'Hammer',
                    ],
                ],
            ],
            'accounts_section' => [
                'label' => 'Accounts (Profit / Loss)',
                'icon' => 'Calculator',
                'sub_modules' => [
                    'accounts_view' => [
                        'label' => 'Accounts',
                        'description' => 'View profit and loss accounts',
                        'route' => 'admin.accounts.index',
                        'icon' => 'Calculator',
                    ],
                ],
            ],
            'unlock_service_section' => [
                'label' => 'Unlock Service Platform',
                'icon' => 'Smartphone',
                'sub_modules' => [
                    'unlock_dashboard' => [
                        'label' => 'Dashboard',
                        'description' => 'View unlock service analytics',
                        'route' => 'admin.unlock.dashboard',
                        'icon' => 'BarChart3',
                    ],
                    'unlock_orders' => [
                        'label' => 'Orders',
                        'description' => 'Manage unlock orders',
                        'route' => 'admin.unlock.orders.index',
                        'icon' => 'Package',
                    ],
                    'unlock_users' => [
                        'label' => 'Shop Users',
                        'description' => 'Manage shop users',
                        'route' => 'admin.unlock.users.index',
                        'icon' => 'Users',
                    ],
                    'unlock_payments' => [
                        'label' => 'Payments',
                        'description' => 'Record shop payments',
                        'route' => 'admin.unlock.payments.index',
                        'icon' => 'CreditCard',
                    ],
                ],
            ],
        ];
    }
}
