<?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_orders', function (Blueprint $table) {
            $table->id();
            $table->string('unique_id')->nullable()->unique();

            $table->string('type')->nullable();
            $table->string('passport_name')->nullable();
            $table->string('passport_surname')->nullable();
            $table->string('phone')->nullable();
            $table->string('email')->nullable();
            $table->string('region')->nullable();

            $table->foreignId('branch_id')->nullable()->constrained('branches')->cascadeOnDelete();
            $table->foreignId('user_id')->nullable()->constrained('users')->cascadeOnDelete();

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

            $table->json('sender_datas')->nullable();
            $table->json('payment_reciever')->nullable();

            $table->json('documents')->nullable();

            $table->string('status')->nullable();
            $table->string('notes')->nullable();

            $table->string('sender_full_name')->nullable();
            $table->string('sender_passport_serie')->nullable();
            $table->string('sender_passport_number')->nullable();
            $table->string('sender_deposit_account')->nullable();

            $table->boolean('paid')->default(true);

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

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