<?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::table('transactions', function (Blueprint $table) {
            // Entity Corporate Information
            $table->jsonb('entity_corporate_summary')->nullable();
            $table->jsonb('entity_corporate_history')->nullable();
            $table->jsonb('entity_corporate_purpose')->nullable();
            $table->jsonb('entity_corporate_sector')->nullable();
            $table->jsonb('entity_corporate_nace')->nullable();
            $table->jsonb('entity_corporate_products')->nullable();
            $table->jsonb('entity_corporate_markets')->nullable();
            $table->jsonb('entity_corporate_supply')->nullable();
            $table->jsonb('entity_corporate_name')->nullable();
            $table->jsonb('entity_corporate_form')->nullable();
            $table->jsonb('entity_corporate_forum')->nullable();
            $table->jsonb('entity_corporate_HQ')->nullable();
            $table->jsonb('entity_corporate_locations')->nullable();
            $table->jsonb('entity_corporate_holding')->nullable();
            $table->jsonb('entity_corporate_shareholders')->nullable();
            $table->jsonb('entity_corporate_board')->nullable();
            $table->jsonb('entity_corporate_supervisory')->nullable();
            $table->jsonb('entity_corporate_powerofattorney')->nullable();
            $table->jsonb('entity_corporate_taxID')->nullable();
            $table->jsonb('entity_corporate_LEI')->nullable();
            $table->jsonb('entity_corporate_UBO')->nullable();
            $table->jsonb('entity_corporate_employeecount')->nullable();
            $table->jsonb('entity_corporate_turnover')->nullable();
            $table->jsonb('entity_corporate_EBIT')->nullable();
            $table->jsonb('entity_corporate_netprofits')->nullable();
            $table->jsonb('entity_corporate_balancesheet')->nullable();
            $table->jsonb('entity_corporate_auditfindings')->nullable();
            $table->jsonb('entity_corporate_insolvency')->nullable();
            $table->jsonb('entity_corporate_liquidation')->nullable();
            $table->jsonb('entity_corporate_adhoc')->nullable();
            $table->jsonb('entity_corporate_pressrelease')->nullable();
            $table->jsonb('entity_corporate_votes')->nullable();
            $table->jsonb('entity_corporate_directordealings')->nullable();
            $table->jsonb('entity_corporate_brands')->nullable();
            $table->jsonb('entity_corporate_website')->nullable();
            $table->jsonb('entity_corporate_domain')->nullable();
            $table->jsonb('entity_corporate_IBAN')->nullable();
            $table->jsonb('entity_corporate_solvency')->nullable();
            $table->jsonb('entity_corporate_rating')->nullable();
            $table->jsonb('entity_corporate_ESG')->nullable();
            $table->jsonb('entity_corporate_license')->nullable();
            $table->jsonb('entity_corporate_warnings')->nullable();
            $table->jsonb('entity_corporate_eusanctions')->nullable();
            $table->jsonb('entity_corporate_ofacsanctions')->nullable();
            $table->jsonb('entity_corporate_uksanctions')->nullable();
            $table->jsonb('entity_corporate_pepexposure')->nullable();
            $table->jsonb('entity_corporate_adversemediascanning')->nullable();
            $table->jsonb('entity_corporate_corruptionexposure')->nullable();
            $table->jsonb('entity_corporate_AMLexposure')->nullable();
            $table->jsonb('entity_corporate_CTYexposure')->nullable();
            $table->jsonb('entity_corporate_adverse')->nullable();
            $table->jsonb('entity_corporate_pep')->nullable();
            $table->jsonb('entity_corporate_adverse2')->nullable();
            $table->jsonb('entity_corporate_exportcontrol')->nullable();
            $table->jsonb('entity_corporate_mediamatch')->nullable();
            $table->jsonb('entity_corporate_haven')->nullable();
            $table->jsonb('entity_corporate_insiders')->nullable();
            $table->jsonb('entity_corporate_courtcases')->nullable();
            $table->jsonb('entity_corporate_manda')->nullable();
            $table->jsonb('entity_corporate_pepdetail')->nullable();

            // Counterparty Corporate Information
            $table->jsonb('counterparty_corporate_summary')->nullable();
            $table->jsonb('counterparty_corporate_history')->nullable();
            $table->jsonb('counterparty_corporate_purpose')->nullable();
            $table->jsonb('counterparty_corporate_sector')->nullable();
            $table->jsonb('counterparty_corporate_nace')->nullable();
            $table->jsonb('counterparty_corporate_products')->nullable();
            $table->jsonb('counterparty_corporate_markets')->nullable();
            $table->jsonb('counterparty_corporate_supply')->nullable();
            $table->jsonb('counterparty_corporate_name')->nullable();
            $table->jsonb('counterparty_corporate_form')->nullable();
            $table->jsonb('counterparty_corporate_forum')->nullable();
            $table->jsonb('counterparty_corporate_HQ')->nullable();
            $table->jsonb('counterparty_corporate_locations')->nullable();
            $table->jsonb('counterparty_corporate_holding')->nullable();
            $table->jsonb('counterparty_corporate_shareholders')->nullable();
            $table->jsonb('counterparty_corporate_board')->nullable();
            $table->jsonb('counterparty_corporate_supervisory')->nullable();
            $table->jsonb('counterparty_corporate_powerofattorney')->nullable();
            $table->jsonb('counterparty_corporate_taxID')->nullable();
            $table->jsonb('counterparty_corporate_LEI')->nullable();
            $table->jsonb('counterparty_corporate_UBO')->nullable();
            $table->jsonb('counterparty_corporate_employeecount')->nullable();
            $table->jsonb('counterparty_corporate_turnover')->nullable();
            $table->jsonb('counterparty_corporate_EBIT')->nullable();
            $table->jsonb('counterparty_corporate_netprofits')->nullable();
            $table->jsonb('counterparty_corporate_balancesheet')->nullable();
            $table->jsonb('counterparty_corporate_auditfindings')->nullable();
            $table->jsonb('counterparty_corporate_insolvency')->nullable();
            $table->jsonb('counterparty_corporate_liquidation')->nullable();
            $table->jsonb('counterparty_corporate_adhoc')->nullable();
            $table->jsonb('counterparty_corporate_pressrelease')->nullable();
            $table->jsonb('counterparty_corporate_votes')->nullable();
            $table->jsonb('counterparty_corporate_directordealings')->nullable();
            $table->jsonb('counterparty_corporate_brands')->nullable();
            $table->jsonb('counterparty_corporate_website')->nullable();
            $table->jsonb('counterparty_corporate_domain')->nullable();
            $table->jsonb('counterparty_corporate_IBAN')->nullable();
            $table->jsonb('counterparty_corporate_solvency')->nullable();
            $table->jsonb('counterparty_corporate_rating')->nullable();
            $table->jsonb('counterparty_corporate_ESG')->nullable();
            $table->jsonb('counterparty_corporate_license')->nullable();
            $table->jsonb('counterparty_corporate_warnings')->nullable();
            $table->jsonb('counterparty_corporate_eusanctions')->nullable();
            $table->jsonb('counterparty_corporate_ofacsanctions')->nullable();
            $table->jsonb('counterparty_corporate_uksanctions')->nullable();
            $table->jsonb('counterparty_corporate_pepexposure')->nullable();
            $table->jsonb('counterparty_corporate_adversemediascanning')->nullable();
            $table->jsonb('counterparty_corporate_corruptionexposure')->nullable();
            $table->jsonb('counterparty_corporate_AMLexposure')->nullable();
            $table->jsonb('counterparty_corporate_CTYexposure')->nullable();
            $table->jsonb('counterparty_corporate_adverse')->nullable();
            $table->jsonb('counterparty_corporate_pep')->nullable();
            $table->jsonb('counterparty_corporate_adverse2')->nullable();
            $table->jsonb('counterparty_corporate_exportcontrol')->nullable();
            $table->jsonb('counterparty_corporate_mediamatch')->nullable();
            $table->jsonb('counterparty_corporate_haven')->nullable();
            $table->jsonb('counterparty_corporate_insiders')->nullable();
            $table->jsonb('counterparty_corporate_courtcases')->nullable();
            $table->jsonb('counterparty_corporate_manda')->nullable();
            $table->jsonb('counterparty_corporate_pepdetail')->nullable();

            // Entity Risk Assessment
            $table->jsonb('entity_sanctions_circumvention')->nullable();
            $table->jsonb('entity_corruption_sector')->nullable();
            $table->jsonb('entity_corruption_country')->nullable();
            $table->jsonb('entity_corruption_relationship')->nullable();
            $table->jsonb('entity_country_risk')->nullable();

            // Counterparty Risk Assessment
            $table->jsonb('counterparty_sanctions_circumvention')->nullable();
            $table->jsonb('counterparty_corruption_sector')->nullable();
            $table->jsonb('counterparty_corruption_country')->nullable();
            $table->jsonb('counterparty_corruption_relationship')->nullable();
            $table->jsonb('counterparty_country_risk')->nullable();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::table('transactions', function (Blueprint $table) {
            $table->dropColumn([
                // Entity Corporate Information
                'entity_corporate_summary',
                'entity_corporate_history',
                'entity_corporate_purpose',
                'entity_corporate_sector',
                'entity_corporate_nace',
                'entity_corporate_products',
                'entity_corporate_markets',
                'entity_corporate_supply',
                'entity_corporate_name',
                'entity_corporate_form',
                'entity_corporate_forum',
                'entity_corporate_HQ',
                'entity_corporate_locations',
                'entity_corporate_holding',
                'entity_corporate_shareholders',
                'entity_corporate_board',
                'entity_corporate_supervisory',
                'entity_corporate_powerofattorney',
                'entity_corporate_taxID',
                'entity_corporate_LEI',
                'entity_corporate_UBO',
                'entity_corporate_employeecount',
                'entity_corporate_turnover',
                'entity_corporate_EBIT',
                'entity_corporate_netprofits',
                'entity_corporate_balancesheet',
                'entity_corporate_auditfindings',
                'entity_corporate_insolvency',
                'entity_corporate_liquidation',
                'entity_corporate_adhoc',
                'entity_corporate_pressrelease',
                'entity_corporate_votes',
                'entity_corporate_directordealings',
                'entity_corporate_brands',
                'entity_corporate_website',
                'entity_corporate_domain',
                'entity_corporate_IBAN',
                'entity_corporate_solvency',
                'entity_corporate_rating',
                'entity_corporate_ESG',
                'entity_corporate_license',
                'entity_corporate_warnings',
                'entity_corporate_eusanctions',
                'entity_corporate_ofacsanctions',
                'entity_corporate_uksanctions',
                'entity_corporate_pepexposure',
                'entity_corporate_adversemediascanning',
                'entity_corporate_corruptionexposure',
                'entity_corporate_AMLexposure',
                'entity_corporate_CTYexposure',
                'entity_corporate_adverse',
                'entity_corporate_pep',
                'entity_corporate_adverse2',
                'entity_corporate_exportcontrol',
                'entity_corporate_mediamatch',
                'entity_corporate_haven',
                'entity_corporate_insiders',
                'entity_corporate_courtcases',
                'entity_corporate_manda',
                'entity_corporate_pepdetail',
                // Counterparty Corporate Information
                'counterparty_corporate_summary',
                'counterparty_corporate_history',
                'counterparty_corporate_purpose',
                'counterparty_corporate_sector',
                'counterparty_corporate_nace',
                'counterparty_corporate_products',
                'counterparty_corporate_markets',
                'counterparty_corporate_supply',
                'counterparty_corporate_name',
                'counterparty_corporate_form',
                'counterparty_corporate_forum',
                'counterparty_corporate_HQ',
                'counterparty_corporate_locations',
                'counterparty_corporate_holding',
                'counterparty_corporate_shareholders',
                'counterparty_corporate_board',
                'counterparty_corporate_supervisory',
                'counterparty_corporate_powerofattorney',
                'counterparty_corporate_taxID',
                'counterparty_corporate_LEI',
                'counterparty_corporate_UBO',
                'counterparty_corporate_employeecount',
                'counterparty_corporate_turnover',
                'counterparty_corporate_EBIT',
                'counterparty_corporate_netprofits',
                'counterparty_corporate_balancesheet',
                'counterparty_corporate_auditfindings',
                'counterparty_corporate_insolvency',
                'counterparty_corporate_liquidation',
                'counterparty_corporate_adhoc',
                'counterparty_corporate_pressrelease',
                'counterparty_corporate_votes',
                'counterparty_corporate_directordealings',
                'counterparty_corporate_brands',
                'counterparty_corporate_website',
                'counterparty_corporate_domain',
                'counterparty_corporate_IBAN',
                'counterparty_corporate_solvency',
                'counterparty_corporate_rating',
                'counterparty_corporate_ESG',
                'counterparty_corporate_license',
                'counterparty_corporate_warnings',
                'counterparty_corporate_eusanctions',
                'counterparty_corporate_ofacsanctions',
                'counterparty_corporate_uksanctions',
                'counterparty_corporate_pepexposure',
                'counterparty_corporate_adversemediascanning',
                'counterparty_corporate_corruptionexposure',
                'counterparty_corporate_AMLexposure',
                'counterparty_corporate_CTYexposure',
                'counterparty_corporate_adverse',
                'counterparty_corporate_pep',
                'counterparty_corporate_adverse2',
                'counterparty_corporate_exportcontrol',
                'counterparty_corporate_mediamatch',
                'counterparty_corporate_haven',
                'counterparty_corporate_insiders',
                'counterparty_corporate_courtcases',
                'counterparty_corporate_manda',
                'counterparty_corporate_pepdetail',
                // Entity Risk Assessment
                'entity_sanctions_circumvention',
                'entity_corruption_sector',
                'entity_corruption_country',
                'entity_corruption_relationship',
                'entity_country_risk',
                // Counterparty Risk Assessment
                'counterparty_sanctions_circumvention',
                'counterparty_corruption_sector',
                'counterparty_corruption_country',
                'counterparty_corruption_relationship',
                'counterparty_country_risk',
            ]);
        });
    }
};
