<?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('bookings', function (Blueprint $table) {
            $table->decimal('advance_payment', 10, 2)->default(0)->after('total_amount');
            $table->decimal('due_payment', 10, 2)->default(0)->after('advance_payment');
            $table->enum('payment_status', ['Unpaid', 'Partial', 'Paid'])->default('Unpaid')->after('due_payment');
        });
    }

    public function down(): void
    {
        Schema::table('bookings', function (Blueprint $table) {
            $table->dropColumn(['advance_payment', 'due_payment', 'payment_status']);
        });
    }
};
