<?php

namespace App\Console\Commands;

use App\Services\Forecasting\OutcomeResolver;
use Illuminate\Console\Attributes\Description;
use Illuminate\Console\Attributes\Signature;
use Illuminate\Console\Command;

#[Signature('forecast:resolve-outcomes')]
#[Description('Pair past weekly forecasts with the actual ULSP from BEIS data and write rows to forecast_outcomes.')]
class ResolveForecastOutcomes extends Command
{
    public function handle(OutcomeResolver $resolver): int
    {
        $count = $resolver->resolvePending();
        $this->info(sprintf('Resolved %d outstanding forecast(s).', $count));

        return self::SUCCESS;
    }
}
