<?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_transaction_splits', function (Blueprint $table) {
            $table->decimal('split_supply_amount', 18, 2)->nullable()->after('split_amount')->comment('분개 공급가액');
            $table->decimal('split_tax', 18, 2)->nullable()->after('split_supply_amount')->comment('분개 부가세');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::table('barobill_card_transaction_splits', function (Blueprint $table) {
            $table->dropColumn(['split_supply_amount', 'split_tax']);
        });
    }
};
