<?php
declare(strict_types=1);

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

MenuRegistry::register('rules_pricing', [
    'label_ar'   => 'القواعد والتسعير',
    'label_en'   => 'Rules & Pricing',
    'icon'       => '⚙️',
    'route'      => '/rules',
    'permission' => 'rules.view',
    'order'      => 150,
    'children'   => [
        ['label_ar' => 'محرك القواعد',   'label_en' => 'Rules Engine',       'route' => '/rules',                      'permission' => 'rules.view',                        'order' => 1],
        ['label_ar' => 'التسعير',        'label_en' => 'Pricing',            'route' => '/pricing',                    'permission' => 'pricing.view',                      'order' => 2],
        ['label_ar' => 'كتالوج الخدمات', 'label_en' => 'Service Catalog',    'route' => '/catalog',                    'permission' => 'pricing.view',                      'order' => 3],
        ['label_ar' => 'خصومات خاصة',   'label_en' => 'Special Discounts',  'route' => '/pricing/special-discounts',  'permission' => 'pricing.special_discounts.view',    'order' => 4],
    ],
]);

PermissionRegistry::register('rules', [
    'rules.view'       => ['ar' => 'عرض القواعد',     'en' => 'View Rules'],
    'rules.edit'       => ['ar' => 'تعديل القواعد',    'en' => 'Edit Rules'],
    'rules.create'     => ['ar' => 'إنشاء قاعدة',     'en' => 'Create Rule'],
    'rules.deactivate' => ['ar' => 'تعطيل قاعدة',     'en' => 'Deactivate Rule'],
]);

PermissionRegistry::register('pricing', [
    'pricing.view'                    => ['ar' => 'عرض التسعير',          'en' => 'View Pricing'],
    'pricing.edit'                    => ['ar' => 'تعديل التسعير',         'en' => 'Edit Pricing'],
    'pricing.create'                  => ['ar' => 'إنشاء تسعير',          'en' => 'Create Pricing'],
    'pricing.special_discounts.view'  => ['ar' => 'عرض الخصومات الخاصة',  'en' => 'View Special Discounts'],
    'pricing.special_discounts.create'=> ['ar' => 'إنشاء خصم خاص',       'en' => 'Create Special Discount'],
    'pricing.special_discounts.edit'  => ['ar' => 'تعديل خصم خاص',       'en' => 'Edit Special Discount'],
]);