<?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('clearance_templates', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('name', 150);
            $table->string('clearance_coverage', 50);
            $table->string('job_classification_id', 50)->index();
            $table->string('recommending_officer_1', 50)->index();
            $table->string('recommending_officer_2', 50)->index();
            $table->string('approving_officer_1', 50)->index();
            $table->string('approving_officer_2', 50)->index()->nullable();
            $table->string('authorizing_hr', 50)->index();
            $table->string('payroll_officer', 50)->index()->nullable();
            $table->string('accounting_officer', 50)->index()->nullable();
            $table->string('treasury_officer', 50)->index()->nullable();
            $table->string('legal_officer', 50)->index()->nullable();
            $table->boolean('enabled')->default(true)->index();
            $table->softDeletes();
            $table->timestamps();
        });
    }

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