api/src/Incentive/Command/SubscriptionsVerificationCommand.php
<?php
/**
* Copyright (c) 2023, MOBICOOP. All rights reserved.
* This project is dual licensed under AGPL and proprietary licence.
***************************
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <gnu.org/licenses>.
***************************
* Licence MOBICOOP described in the file
* LICENSE
*/
namespace App\Incentive\Command;
use App\Incentive\Service\Manager\SubscriptionManager;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
class SubscriptionsVerificationCommand extends Command
{
/**
* @var SubscriptionManager
*/
private $_subscriptionManager;
public function __construct(SubscriptionManager $subscriptionManager)
{
$this->_subscriptionManager = $subscriptionManager;
parent::__construct();
}
protected function configure()
{
$this
->setName('app:incentive:subscriptions-verification')
->setDescription('Request verification of journeys registered with mobConnect.')
->setHelp('Asks mobConnect, 7 days after their declaration, if each journey is verified.')
;
}
protected function execute(InputInterface $input, OutputInterface $output)
{
return $this->_subscriptionManager->verifySubscriptions();
}
}