<?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('payment_links', function (Blueprint $table) {
            $table->id();
            $table->foreignId('id_status')->constrained('statuses');
            $table->foreignId('id_user')->constrained('users');
            $table->foreignId('id_user_update')->constrained('users');
            $table->decimal('amount', 8, 2);
            $table->string('description', 250);
            $table->string('invoice');
            $table->string('token', 250)->nullable();
            $table->dateTime('expiration_token')->nullable();
            $table->string('email');
            $table->string('email_name');
            $table->string('email_lastname');
            // $table->string('connexpay_guid')->nullable();
            // $table->string('connexpay_status')->nullable();
            // $table->string('connexpay_type')->nullable();
            // $table->string('connexpay_batch_status')->nullable();
            // $table->string('connexpay_time_stamp')->nullable();
            // $table->string('connexpay_device_guid')->nullable();
            // $table->decimal('connexpay_amount', 8, 2)->nullable();
            // $table->boolean('connexpay_activated')->nullable();
            // $table->string('connexpay_tender_type')->nullable();
            // $table->decimal('connexpay_effective_amount', 8, 2)->nullable();
            // $table->string('connexpay_risk_response_transaction_id')->nullable();
            // $table->string('connexpay_risk_response_response')->nullable();
            // $table->string('connexpay_risk_response_reason')->nullable();
            // $table->string('connexpay_risk_response_score')->nullable();
            // $table->string('connexpay_risk_response_omniscore')->nullable();
            // $table->string('connexpay_order_number')->nullable();
            // $table->string('connexpay_card_data_source')->nullable();
            // $table->string('connexpay_batch_guid')->nullable();
            // $table->string('connexpay_connexpay_transaction_guid')->nullable();
            // $table->string('connexpay_connexpay_transaction_expected_payments')->nullable();
            // $table->string('connexpay_connexpay_transaction_incoming_trans_code')->nullable();
            // $table->string('connexpay_processor_status_code')->nullable();
            // $table->string('connexpay_processor_response_message')->nullable();
            // $table->boolean('connexpay_was_processed')->nullable();
            // $table->string('connexpay_auth_code')->nullable();
            // $table->string('connexpay_ref_number')->nullable();
            // $table->text('connexpay_customer_receipt')->nullable();
            // $table->string('connexpay_generated_by')->nullable();
            // $table->string('connexpay_card_card_holder_name')->nullable();
            // $table->string('connexpay_card_card_type')->nullable();
            // $table->string('connexpay_address_verification_code')->nullable();
            // $table->string('connexpay_address_verification_result')->nullable();
            // $table->string('connexpay_cvv_verification_code')->nullable();
            // $table->string('connexpay_cvv_verification_result')->nullable();
            // $table->string('connexpay_cavv_response_code')->nullable();
            // $table->string('connexpay_wallet_provider')->nullable();
            // $table->boolean('connexpay_is_from_issue_lite')->nullable();
            // $table->decimal('connexpay_remaining_amount', 8, 2)->nullable();
            $table->string('authorize_ref_id', 20)->nullable();
            $table->string('authorize_message_result_code', 6)->nullable();
            $table->string('authorize_message_code', 6)->nullable();
            $table->string('authorize_message_text', 150)->nullable();
            $table->string('authorize_transaction_response_code', 1)->nullable();
            $table->string('authorize_transaction_auth_code', 6)->nullable();
            $table->string('authorize_transaction_avs_result_code', 1)->nullable();
            $table->string('authorize_transaction_cvv_result_code', 1)->nullable();
            $table->string('authorize_transaction_cavv_result_code', 1)->nullable();
            $table->string('authorize_transaction_trans_id', 100)->nullable();
            $table->string('authorize_transaction_ref_trans_id', 100)->nullable();
            $table->string('authorize_transaction_account_type', 50)->nullable();
            $table->string('authorize_transaction_message_code', 6)->nullable();
            $table->string('authorize_transaction_message_description', 150)->nullable();
            $table->string('authorize_transaction_error_code', 6)->nullable();
            $table->string('authorize_transaction_error_text', 150)->nullable();

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

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