<?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('identity_checks', function (Blueprint $table) {
            $table->id();
            $table->foreignId('visitor_id')->constrained('visitors')->onDelete('cascade');
            $table->string('rut_queried');
            $table->boolean('is_valid')->default(false);
            $table->string('api_provider')->default('registro_civil_mock');
            $table->json('raw_response')->nullable(); // Guardar respuesta raw de la API
            $table->timestamps();
        });
    }

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