<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateParkedTransactionsTable extends Migration
{
    public function up()
    {
        Schema::create('parked_transactions', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('application_id')->index();
            $table->decimal('amount', 15, 2)->default(0);
            $table->date('payment_date')->nullable();
            $table->date('payment_reconciliation_date')->nullable();
            $table->string('payment_for')->nullable();
            $table->string('payment_mode')->nullable();
            $table->string('trasanction_id')->nullable();
            $table->string('cf_transaction_id')->nullable();
            $table->string('trasanction_acknowledgement')->nullable();
            $table->string('online_payment_id')->nullable();
            $table->string('payment_status')->nullable();
            $table->string('wallet_name')->nullable();
            $table->integer('bank_id')->nullable();
            $table->integer('paid_by')->nullable();
            $table->integer('collected_by')->nullable();
            $table->integer('collected_by_type')->nullable();
            $table->string('umrn')->nullable();
            $table->string('reason')->nullable();
            $table->string('status')->default('success');
            $table->tinyInteger('adjust_with_disbursement')->default(0);
            $table->tinyInteger('is_verify')->default(0);
            $table->enum('reconciliation_status', ['parked', 'reconciled'])->default('parked')->index();
            $table->timestamps();
        });
    }

    public function down()
    {
        Schema::dropIfExists('parked_transactions');
    }
}
