<?php

namespace App\Console\Commands;

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

class ProcessTicketEscalations extends Command
{
    protected $signature = 'tickets:process-escalations';

    protected $description = 'Process time-based escalation rules for open tickets';

    public function handle(TicketEscalationService $service): int
    {
        $escalated = $service->processAllOpenTickets();

        $this->info("Escalation check complete: {$escalated} ticket(s) escalated.");

        return 0;
    }
}
