<?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('izin_sakits', function (Blueprint $table) {
    $table->id();
    $table->foreignId('karyawan_id')->constrained('karyawans');
    $table->date('tanggal_mulai');
    $table->date('tanggal_selesai');
    $table->enum('jenis', ['izin', 'sakit']);
    $table->text('keterangan')->nullable();
    $table->string('bukti_file')->nullable();
    $table->enum('status', ['pending', 'disetujui', 'ditolak'])->default('pending');
    $table->foreignId('disetujui_oleh')->nullable()->constrained('users');
    $table->timestamps();
});

    }

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