<?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('purchase_orders', function (Blueprint $table) {
            $table->string('invoice_number', 11)->nullable()->comment('發票號碼 (格式: AB-12345678)');
            $table->date('invoice_date')->nullable()->comment('發票日期');
            $table->decimal('invoice_amount', 12, 2)->nullable()->comment('發票金額');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::table('purchase_orders', function (Blueprint $table) {
            $table->dropColumn(['invoice_number', 'invoice_date', 'invoice_amount']);
        });
    }
};
