<?php

declare(strict_types=1);

namespace KupShop\BonusProgramBundle\AdminRegister;

use KupShop\AdminBundle\AdminRegister\AdminRegister;
use KupShop\AdminBundle\AdminRegister\IAdminRegisterDynamic;
use KupShop\AdminBundle\AdminRegister\IAdminRegisterStatic;
use KupShop\BonusProgramBundle\BonusProgramBundle;

class BonusProgramAdminRegister extends AdminRegister implements IAdminRegisterDynamic, IAdminRegisterStatic
{
    public static function getMenu(): array
    {
        if (!findModule(\Modules::BONUS_PROGRAM, \Modules::SUB_POINTS_EXCHANGE)) {
            return [];
        }

        return [
            static::createMenuItem('ordersMenu', [
                'name' => 'BonusProgramExchange',
                'left' => 's=menu.php&type=BonusProgramExchange', 'right' => 's=list.php&type=BonusProgramExchange',
            ]),
        ];
    }

    public function getDynamicPermissions(): array
    {
        return [
            static::createPermissions('BonusProgramExchange', [\Modules::BONUS_PROGRAM, \Modules::SUB_POINTS_EXCHANGE], ['BONUS_PROGRAM_EXCHANGE']),
        ];
    }

    public function getActivityLogTags(): array
    {
        return [
            static::createActivityLogTag(BonusProgramBundle::LOG_TAG_BONUS_PROGRAM, translate('activityLogTag', 'bonus_program')),
        ];
    }
}
