<?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('leave_types', function (Blueprint $table) {
            $table->id();
            $table->unsignedBigInteger('company_id')->nullable(); // users.id of role_id=2
            $table->unsignedBigInteger('superadmin_id')->nullable();
            $table->string('leave_code');
            $table->string('leave_name');
            $table->enum('leave_type', ['Yearly', 'Monthly'])->default('Yearly');
            $table->boolean('include_weekly_off')->default(false);
            $table->boolean('include_holiday')->default(false);
            $table->boolean('is_paid_leave')->default(false);
            $table->boolean('is_carry_forward')->default(false);
            $table->timestamps();
        });
    }

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