<?php

namespace Lc\CaracoleBundle\Command;

use Lc\SovBundle\Builder\Setting\SettingBuilder;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;

class MerchantSettingInitCommand extends Command
{
    protected static $defaultName = 'setting:merchant:init';
    protected static $defaultDescription = 'Initialise les MerchantSetting.';

    protected SettingBuilder $settingBuilder;

    public function __construct(string $name = null, SettingBuilder $settingBuilder)
    {
        parent::__construct($name);
        $this->settingBuilder = $settingBuilder;
    }

    /**
     * {@inheritdoc}
     */
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->io = new SymfonyStyle($input, $output);
        $this->settingBuilder->initMerchantSettings();
        $this->io->success('Les MerchantSetting ont bien été initialisées.');
        return Command::SUCCESS;
    }
}