<?php

declare(strict_types=1);

namespace App\Console\Commands;

use App\Jobs\Supplier\RefreshSupplierSessionJob;
use Illuminate\Console\Command;

final class SupplierSessionRefreshCommand extends Command
{
    protected $signature = 'supplier:session:refresh';

    protected $description = 'Принудительный refresh session cookie+CSRF из crm.bp-gr.ru (Plan 3 Task 5)';

    public function handle(): int
    {
        dispatch_sync(app(RefreshSupplierSessionJob::class));
        $this->info('Supplier session refreshed.');

        return self::SUCCESS;
    }
}
