<?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::create('visa_master_payment_order_items', function (Blueprint $table) {
            $table->id();
            $table->foreignId('visa_master_payment_order_id')->constrained('visa_master_payment_orders')->nullOnDelete();
            $table->foreignId('online_payment_id')->nullable()->constrained('online_payments')->nullOnDelete();

            $table->string('payer_name')->nullable();
            $table->string('payer_card')->nullable();

            $table->string('payment_order_number')->nullable();

            $table->string('tmt_payment_amount');
            $table->string('usd_payment_amount');
            $table->boolean('paid')->default(false);
            $table->boolean('synced_with_system')->nullable()->default(false);

            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('visa_master_payment_order_items');
    }
};
