<?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('impact_factors', function (Blueprint $table) {
            $table->id();
            $table->foreignId('solicitor_id')->nullable()
                ->constrained()
                ->cascadeOnDelete();
            $table->foreignId('claim_id')->constrained()->onDelete('cascade');

            $table->boolean('has_received_relevant_payment')->nullable();
            $table->boolean('has_criminal_conviction')->nullable();

            $table->date('payment_date')->nullable();
            $table->string('paying_organisation')->nullable();
            $table->string('payment_amount')->nullable();

            $table->timestamps();
        });
    }

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