26 lines
702 B
PHP
26 lines
702 B
PHP
<?php
|
|
|
|
namespace App\Console\Commands;
|
|
|
|
use App\Services\InvestmentOpportunityAlerts;
|
|
use Illuminate\Console\Command;
|
|
|
|
final class DispatchInvestmentAlerts extends Command
|
|
{
|
|
protected $signature = 'investmoz:dispatch-opportunity-alerts';
|
|
|
|
protected $description = 'Generate due opt-in alerts from public catalogues, without external messages';
|
|
|
|
public function handle(InvestmentOpportunityAlerts $alerts): int
|
|
{
|
|
if (! $alerts->installed()) {
|
|
$this->warn('Opportunity alerts schema is not installed.');
|
|
|
|
return self::SUCCESS;
|
|
}
|
|
$this->info('Matched public catalogue items: '.$alerts->dispatchDue());
|
|
|
|
return self::SUCCESS;
|
|
}
|
|
}
|