<?php

namespace App\Console\Commands;

use App\Services\Reports\SchemaIntrospector;
use Illuminate\Console\Command;

class ReportsFlushSchemaCommand extends Command
{
    protected $signature = 'reports:flush-schema';
    protected $description = 'Flush cached schema introspection (tables + FKs) for custom reports builder';

    public function handle(SchemaIntrospector $schema): int
    {
        $schema->flushCache();
        $this->info('Reports schema cache flushed.');
        return self::SUCCESS;
    }
}
