<?php

namespace App\Console\Commands;

use App\Services\ReminderDispatcher;
use Illuminate\Console\Command;

class SendReminderNotifications extends Command
{
    protected $signature = 'hisaab:send-reminders';

    protected $description = 'Dispatch due Flowieons reminder notifications';

    public function handle(ReminderDispatcher $dispatcher): int
    {
        $sent = $dispatcher->dispatchDue();

        $this->info(sprintf('Dispatched %d reminder notification(s).', $sent->count()));

        return self::SUCCESS;
    }
}
