<?php

namespace Sibs\Sibs\Setup;

use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\ModuleDataSetupInterface;
use Magento\Framework\Setup\UpgradeDataInterface;
use Magento\Sales\Model\Order\StatusFactory;
use Magento\Sales\Model\ResourceModel\Order\StatusFactory as StatusResourceFactory;
use Sibs\Sibs\Setup\Seeders\UpgradeData221;

class UpgradeData implements UpgradeDataInterface
{
    /**
     * Status Factory.
     *
     * @var StatusFactory
     */
    protected $statusFactory;

    /**
     * Status Resource Factory.
     *
     * @var StatusResourceFactory
     */
    protected $statusResourceFactory;

    /**
     * InstallData constructor.
     *
     * @param StatusFactory $statusFactory
     * @param StatusResourceFactory $statusResourceFactory
     */
    public function __construct(
        StatusFactory $statusFactory,
        StatusResourceFactory $statusResourceFactory
    ) {
        $this->statusFactory         = $statusFactory;
        $this->statusResourceFactory = $statusResourceFactory;
    }

    /**
     * @inheritdoc
     */
    public function upgrade(
        ModuleDataSetupInterface $setup,
        ModuleContextInterface $context
    ) {
        $setup->startSetup();

        (new UpgradeData221($context, $this->statusFactory, $this->statusResourceFactory))->upgrade($setup);
        // add new seeds here

        $setup->endSetup();
    }
}
