<?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('tarifas_ajustador', function (Blueprint $table) {
            $table->id();
            $table->foreignId('ajustador_id')->constrained()->onDelete('cascade');
            $table->enum('tipo_vehiculo', ['liviano', 'pesado', 'express', 'virtual', 'particular']);
            $table->decimal('valor', 10, 2);
            $table->boolean('activo')->default(true);
            $table->timestamps();

            $table->unique(['ajustador_id', 'tipo_vehiculo']);
        });
    }

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