<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    public function up(): void
    {
        Schema::create('pan_verifications', function (Blueprint $table) {
            $table->id();
            $table->foreignId('verification_log_id')->nullable()->constrained('verification_logs')->onDelete('cascade');
            $table->foreignId('api_client_id')->nullable()->constrained('api_clients')->onDelete('set null');
            $table->json('input_parameters');
            $table->string('status');
            $table->string('provider');
            $table->integer('response_time_ms');
            $table->text('error_message')->nullable();
            $table->timestamp('created_at')->useCurrent();
        });
    }

    public function down(): void
    {
        Schema::dropIfExists('pan_verifications');
    }
};
