<?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::table('barobill_card_transactions', function (Blueprint $table) {
            // 공제 유형: 공제(deductible) / 불공(non_deductible)
            $table->string('deduction_type', 20)->nullable()->after('account_name')->comment('공제유형: deductible/non_deductible');
            // 증빙/판매자상호 (사용자 수정용)
            $table->string('evidence_name', 255)->nullable()->after('deduction_type')->comment('증빙/판매자상호 (수정용)');
            // 내역 (사용자 수정용)
            $table->string('description', 500)->nullable()->after('evidence_name')->comment('내역 (수정용)');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::table('barobill_card_transactions', function (Blueprint $table) {
            $table->dropColumn(['deduction_type', 'evidence_name', 'description']);
        });
    }
};
