<?php

namespace App\Console\Commands;

use App\Models\Report;
use Illuminate\Console\Command;

/**
 * Stub for the noc:reports:run-due scheduled command.
 *
 * The Report model exists (recording generated CSV/PDF artifacts) but the
 * scheduling infrastructure isn't fully built out yet — this command is
 * called every 5 minutes by the scheduler and is intentionally a no-op
 * placeholder so the scheduler doesn't spam errors with "command not found."
 *
 * When scheduled-report functionality is built (custom periods, recipients,
 * automatic delivery via email/Slack), this command will look up Report
 * rows whose `next_run_at` is in the past, regenerate the artifact, push
 * it through the configured delivery channel, and bump `next_run_at`.
 *
 * For now: log + exit cleanly so the scheduler stays quiet.
 */
class RunDueReportsCommand extends Command
{
    protected $signature = 'noc:reports:run-due';
    protected $description = 'Generate any reports whose schedule has come due (currently a no-op placeholder)';

    public function handle(): int
    {
        // No-op for now. When scheduling support is added, this method
        // will iterate through Report rows with next_run_at <= now() and
        // regenerate them.
        return self::SUCCESS;
    }
}
