<?php
/**
 * Mirasvit
 *
 * This source file is subject to the Mirasvit Software License, which is available at https://mirasvit.com/license/.
 * Do not edit or add to this file if you wish to upgrade the to newer versions in the future.
 * If you wish to customize this module for your needs.
 * Please refer to http://www.magentocommerce.com for more information.
 *
 * @category  Mirasvit
 * @package   mirasvit/module-rma
 * @version   2.1.34
 * @copyright Copyright (C) 2022 Mirasvit (https://mirasvit.com/)
 */



namespace Mirasvit\Rma\Controller\Adminhtml\Rma;

use Mirasvit\Rma\Controller\Adminhtml\Rma;
use Mirasvit\Rma\Model\RmaFactory;
use Magento\Backend\App\Action\Context;

class ConvertTicket extends Rma
{
    private $rmaFactory;

    public function __construct(
        RmaFactory $rmaFactory,
        Context $context
    ) {
        $this->rmaFactory = $rmaFactory;

        parent::__construct($context);
    }

    /**
     * {@inheritdoc}
     */
    public function execute()
    {
        /** @var \Mirasvit\Rma\Model\Rma $rma */
        $rma = $this->rmaFactory->create()->load($this->getRequest()->getParam('id'));

        $this->_redirect('helpdesk/ticket/add', ['customer_id' => $rma->getCustomerId()]);
    }
}
