<?php

declare(strict_types=1);

namespace KupShop\StoresBundle\Resources\script;

use KupShop\KupShopBundle\Util\Compat\ServiceContainer;
use KupShop\StoresBundle\Utils\Export\StoreHistoryExport;

class HistoryTestScript extends \KupShop\AdminBundle\Util\Script\Script
{
    protected static $name = 'Test historie';

    protected static $defaultParameters = [
        'run' => true,
    ];

    protected function run(array $arguments)
    {
        if (!$arguments['run'] && !isLocalDevelopment()) {
            return;
        }

        $service = ServiceContainer::getService(StoreHistoryExport::class);
        $service->exportStoreHistory(1, '2024-06-05');
    }
}

return HistoryTestScript::class;
