<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    public function up(): void
    {
        Schema::create('employees', function (Blueprint $table) {
            $table->id();
            $table->string('full_name');
            $table->string('address')->nullable();
            $table->string('phone')->nullable();
            $table->string('job_title')->nullable();
            $table->unsignedBigInteger('base_salary')->default(0);
            $table->foreignId('role_id')->constrained('roles');
            $table->unsignedInteger('general_percentage')->default(0);
            $table->unsignedInteger('role_percentage')->default(0);
            $table->timestamps();
        });
    }

    public function down(): void
    {
        Schema::dropIfExists('employees');
    }
};
