<?php

namespace KupShop\ReclamationsBundle\Admin\Actions;

use KupShop\AdminBundle\Admin\Actions\AbstractAction;
use KupShop\AdminBundle\Admin\Actions\ActionResult;
use KupShop\AdminBundle\Admin\Actions\IAction;

class ReclamationAction extends AbstractAction implements IAction
{
    public function getTypes(): array
    {
        return ['orders'];
    }

    public function getName(): string
    {
        return 'Vytvořit reklamaci';
    }

    public function getHotKeys(): array
    {
        return [
            'key' => 'R',
            'modifier' => 'ALT+',
        ];
    }

    public function getPriority(): int
    {
        return -50;
    }

    public function execute(&$data, array $config, string $type): ActionResult
    {
        return new ActionResult(true);
    }

    public function hasDialog()
    {
        return false;
    }

    public function getLaunchHandler()
    {
        return "nw('Reclamations', '', 'id_order={$this->getId()}')";
    }

    public function isEnabled()
    {
        return findModule(\Modules::RECLAMATIONS);
    }
}
