<?php

namespace KupShop\OrderingBundle\Command;

use KupShop\OrderingBundle\EventListener\CronListener;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

class NotifyWaitingPackageCommand extends Command
{
    /** @var CronListener */
    private $cronListener;

    public function __construct(CronListener $cronListener)
    {
        parent::__construct();
        $this->cronListener = $cronListener;
    }

    protected function configure()
    {
        $this
            ->setName('kupshop:ordering:notify-waiting-package')
            ->setDescription('Notify customers about waiting packages');
    }

    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->cronListener->handleNotifyWaitingPackage();

        return 0;
    }
}
