<?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('online_payment_histories', function (Blueprint $table) {
            $table->id();

            $table->string('refunded_amount')->nullable();
            $table->string('booking_number')->nullable();
            $table->string('amount')->nullable();
            $table->string('depositedAmount')->nullable();
            $table->string('orderNumber')->nullable();
            $table->string('description')->nullable();
            $table->string('orderId')->nullable();
            $table->string('cardholderName')->nullable();
            $table->string('pan')->nullable();
            $table->boolean('approvalCode')->default(false);
            $table->string('expiration')->nullable();
            $table->string('formUrl')->nullable();
            $table->string('successUrl')->nullable();
            $table->string('errorUrl')->nullable();
            $table->string('api_client')->nullable();
            $table->string('paymentStatus')->nullable();
            $table->string('callbackStatus')->nullable();
            $table->string('username')->nullable();

            $table->unsignedBigInteger('online_paymantable_id')->index()->nullable();
            $table->string('online_paymantable_type')->index()->nullable();

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

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