<?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('service_reports', function (Blueprint $table) {
            $table->id(); // Ini ID otomatis
            $table->string('pelapor');
            $table->string('divisi');
            $table->string('perangkat');
            $table->string('no_inventaris')->nullable(); // nullable biar kalau kosong gak error
            $table->text('keluhan');
            $table->string('urgensi');
            $table->string('foto')->nullable();
            $table->string('status')->default('Pending'); // Default awal laporan adalah Pending
            $table->date('tgl_selesai')->nullable();
            $table->text('catatan_it')->nullable();
            $table->timestamps(); // Ini buat nyatet tanggal lapor & update otomatis
        });
    }

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