<?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('personnel_action_forms', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->unsignedBigInteger('employee_id')->index();
            $table->string('employment_status_id', 50);
            $table->string('position_id', 50);
            $table->string('jg_step', 50)->nullable();
            $table->string('unit_id', 50)->nullable();
            $table->string('present_salary', 150);
            $table->string('allowance', 150)->nullable();
            $table->date('last_salary_increase_date')->nullable();
            $table->date('last_promotion_date')->nullable();
            $table->string('length_of_service', 50)->nullable();
            $table->string('nature_of_request_id', 50);
            $table->string('position', 50);
            $table->string('unit', 50);
            $table->string('other', 50)->nullable();
            $table->string('salary_increase_to', 150)->nullable();
            $table->string('salary_increment', 150)->nullable();
            $table->string('honorarium', 150)->nullable();
            $table->string('peso', 150)->nullable();
            $table->string('incentive', 150)->nullable();
            $table->string('commission', 150)->nullable();
            $table->string('benefits', 250)->nullable();
            $table->string('supporting_documents_id', 50)->nullable();
            $table->string('supporting_documents', 250)->nullable();
            $table->date('effectivity')->nullable();
            $table->string('inclusive_period', 150)->nullable();
            $table->string('immediate_head', 50)->nullable();
            $table->string('immediate_head_position', 50)->nullable();
            $table->text('justification_request')->nullable();
            $table->string('requested_by', 50)->nullable();
            $table->string('recommended_by', 50)->nullable();
            $table->string('concurred_by', 50)->nullable();
            $table->string('endorsed_by', 50)->nullable();
            $table->string('approved_by', 50)->nullable();
            $table->string('denied_by', 50)->nullable();
            $table->text('denied_reason')->nullable();
            $table->date('approved_at')->nullable();
            $table->date('denied_at')->nullable();
            $table->tinyInteger('status')->default(0);
            $table->boolean('enabled')->default(true)->index();
            $table->softDeletes();
            $table->timestamps();
        });
    }

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