<?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('personal_zurich', function (Blueprint $table) {
            $table->id();
            $table->foreignId('tenant_id')->constrained()->onDelete('cascade');
            $table->string('codigo_sistema')->unique();
            $table->string('nombre');
            $table->string('cargo');
            $table->string('email')->nullable();
            $table->string('telefono')->nullable();
            $table->enum('rol', ['ejecutivo', 'director', 'reinspector', 'gerente', 'coordinador'])->default('ejecutivo');
            $table->boolean('activo')->default(true);
            $table->timestamps();
        });
    }

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