<?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('approval_steps', function (Blueprint $table) {
            $table->integer('parallel_group')->nullable()->after('step_type')
                ->comment('병렬 그룹 번호');
            $table->foreignId('acted_by')->nullable()->after('approver_id')
                ->comment('실제 처리자 (대결)');
            $table->string('approval_type', 20)->default('normal')->after('status')
                ->comment('결재 유형: normal/pre_decided/delegated');
        });
    }

    public function down(): void
    {
        Schema::table('approval_steps', function (Blueprint $table) {
            $table->dropColumn(['parallel_group', 'acted_by', 'approval_type']);
        });
    }
};
