<?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::table('employee_salaries', function (Blueprint $table) {
            // Status apakah karyawan ini diikutkan BPJS atau tidak
            $table->boolean('has_bpjs')->default(false)->after('salary_type');
            
            // Nomor Kepesertaan
            $table->string('bpjs_kesehatan_number', 50)->nullable()->after('has_bpjs');
            $table->string('bpjs_ketenagakerjaan_number', 50)->nullable()->after('bpjs_kesehatan_number');
        });
    }

    public function down(): void
    {
        Schema::table('employee_salaries', function (Blueprint $table) {
            $table->dropColumn(['has_bpjs', 'bpjs_kesehatan_number', 'bpjs_ketenagakerjaan_number']);
        });
    }
};