<?php

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

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('redress_estimates', function (Blueprint $table) {
            $table->id();
            $table->foreignId('claim_id')->constrained()->cascadeOnDelete();
        
            $table->string('level')->nullable(); // Level 1-5
            $table->integer('value_min')->nullable();
            $table->integer('value_max')->nullable();
            $table->string('confidence')->nullable(); // Low / Moderate / High
            $table->text('rationale')->nullable();
        
            $table->json('statement_results')->nullable();
            $table->json('raw_response')->nullable();
        
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('redress_estimates');
    }
};
