<?php

namespace App\Console\Commands;

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

class FlushApiUsage extends Command
{
    protected $signature = 'api-usage:flush';

    protected $description = 'Flush buffered API usage counters from Redis into the api_usage table.';

    public function handle(ApiUsageTracker $tracker): int
    {
        $tracker->flush();

        return self::SUCCESS;
    }
}
