<?php
declare(strict_types=1);

use App\Core\Registries\MenuRegistry;
use App\Core\Registries\PermissionRegistry;

MenuRegistry::register('tutorials', [
    'label_ar'   => 'الشروحات',
    'label_en'   => 'Tutorials',
    'icon'       => 'graduation-cap',
    'route'      => '/tutorials',
    'permission' => 'tutorials.view',
    'parent'     => null,
    'order'      => 990,
    'children'   => [
        // ── العمليات (Operations) ──────────────────────────
        ['label_ar' => 'شئون العضوية',           'label_en' => 'Membership',           'route' => '/tutorials/membership',        'permission' => 'tutorials.view', 'order' => 1],
        ['label_ar' => 'الأنشطة الرياضية',       'label_en' => 'Sports Activity',      'route' => '/tutorials/sports-activity',   'permission' => 'tutorials.view', 'order' => 2],
        ['label_ar' => 'الحجوزات',               'label_en' => 'Reservations',         'route' => '/tutorials/reservations',      'permission' => 'tutorials.view', 'order' => 3],
        ['label_ar' => 'البطولات',               'label_en' => 'Tournaments',          'route' => '/tutorials/tournaments',       'permission' => 'tutorials.view', 'order' => 4],
        ['label_ar' => 'الكارنيهات والدعوات',    'label_en' => 'Carnets & Invitations','route' => '/tutorials/carnets',           'permission' => 'tutorials.view', 'order' => 5],
        ['label_ar' => 'أولياء الأمور',          'label_en' => 'Parents',              'route' => '/tutorials/parents',           'permission' => 'tutorials.view', 'order' => 6],
        // ── المالية (Finance) ──────────────────────────────
        ['label_ar' => 'خزنة العضويات',          'label_en' => 'Cashier',              'route' => '/tutorials/cashier',           'permission' => 'tutorials.view', 'order' => 10],
        ['label_ar' => 'الخزنة الفرعية',         'label_en' => 'Treasury',             'route' => '/tutorials/treasury',          'permission' => 'tutorials.view', 'order' => 11],
        ['label_ar' => 'الخزينة والمدفوعات',     'label_en' => 'Payments',             'route' => '/tutorials/payments',          'permission' => 'tutorials.view', 'order' => 12],
        ['label_ar' => 'المحاسبة والدفتر العام', 'label_en' => 'Accounting',           'route' => '/tutorials/accounting',        'permission' => 'tutorials.view', 'order' => 13],
        // ── سلسلة التوريد (Supply Chain) ───────────────────
        ['label_ar' => 'إدارة المخازن',          'label_en' => 'Inventory',            'route' => '/tutorials/inventory',         'permission' => 'tutorials.view', 'order' => 20],
        ['label_ar' => 'المشتريات',              'label_en' => 'Procurement',          'route' => '/tutorials/procurement',       'permission' => 'tutorials.view', 'order' => 21],
        ['label_ar' => 'المبيعات',               'label_en' => 'Sales',                'route' => '/tutorials/sales',             'permission' => 'tutorials.view', 'order' => 22],
        // ── الشئون الإدارية (Administration) ───────────────
        ['label_ar' => 'الموارد البشرية',        'label_en' => 'HR',                   'route' => '/tutorials/hr',                'permission' => 'tutorials.view', 'order' => 30],
        ['label_ar' => 'اللجنة الطبية',          'label_en' => 'Medical Board',        'route' => '/tutorials/medical-board',     'permission' => 'tutorials.view', 'order' => 31],
        // ── التقارير والنظام (Reports & System) ────────────
        ['label_ar' => 'التقارير',               'label_en' => 'Reports',              'route' => '/tutorials/reports',           'permission' => 'tutorials.view', 'order' => 40],
        ['label_ar' => 'المستخدمون والصلاحيات',  'label_en' => 'Users & Permissions',  'route' => '/tutorials/roles',             'permission' => 'tutorials.view', 'order' => 41],
        ['label_ar' => 'مصفوفة الصلاحيات',       'label_en' => 'Access Matrix',        'route' => '/tutorials/access-matrix',     'permission' => 'tutorials.view', 'order' => 42],
        ['label_ar' => 'القواعد والتسعير',       'label_en' => 'Rules & Pricing',      'route' => '/tutorials/rules',             'permission' => 'tutorials.view', 'order' => 43],
        // ── كتاب النظام (Export) ───────────────────────────
        ['label_ar' => 'كتاب النظام (PDF)',      'label_en' => 'Book of the ERP',      'route' => '/tutorials/book',              'permission' => 'tutorials.view', 'order' => 99, 'icon' => 'book-open'],
    ],
]);

PermissionRegistry::register('tutorials', [
    'tutorials.view' => ['ar' => 'عرض الشروحات', 'en' => 'View Tutorials'],
]);
