<?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('seguimiento_reparaciones', function (Blueprint $table) {
            $table->id();
            $table->foreignId('caso_id')->constrained()->onDelete('cascade');
            $table->enum('nivel_dano', ['alta', 'media', 'baja']);
            $table->boolean('vehiculo_ingresado')->default(false);
            $table->timestamp('fecha_ingreso_taller')->nullable();
            $table->timestamp('fecha_salida_taller')->nullable();
            $table->enum('tipo_trabajo', ['latoneria', 'mecanica', 'pintura'])->nullable();
            $table->boolean('es_alcance')->default(false);
            $table->text('observaciones')->nullable();
            $table->timestamps();
        });
    }

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