<?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('pos_transactions', function (Blueprint $table) {
            $table->bigInteger('service_fee_amount')->default(0)->after('tax_amount');
        });

        Schema::table('invoices', function (Blueprint $table) {
            $table->bigInteger('service_fee_amount')->default(0)->after('tax_amount');
        });
    }

    public function down(): void
    {
        Schema::table('pos_transactions', function (Blueprint $table) {
            $table->dropColumn('service_fee_amount');
        });

        Schema::table('invoices', function (Blueprint $table) {
            $table->dropColumn('service_fee_amount');
        });
    }
};
