<?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('api_clients', function (Blueprint $table) {
            $table->decimal('wallet_balance', 10, 2)->default(100.00);
            $table->decimal('pan_charge', 8, 2)->default(2.00);
            $table->decimal('aadhaar_otp_charge', 8, 2)->default(1.00);
            $table->decimal('aadhaar_submit_charge', 8, 2)->default(3.00);
            $table->decimal('aadhaar_basic_charge', 8, 2)->default(2.00);
            $table->decimal('aadhaar_pan_link_charge', 8, 2)->default(1.50);
            $table->decimal('gst_charge', 8, 2)->default(3.00);
        });

        Schema::table('verification_logs', function (Blueprint $table) {
            $table->string('company_name')->nullable();
            $table->decimal('charged_amount', 8, 2)->default(0.00);
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::table('api_clients', function (Blueprint $table) {
            $table->dropColumn([
                'wallet_balance',
                'pan_charge',
                'aadhaar_otp_charge',
                'aadhaar_submit_charge',
                'aadhaar_basic_charge',
                'aadhaar_pan_link_charge',
                'gst_charge',
            ]);
        });

        Schema::table('verification_logs', function (Blueprint $table) {
            $table->dropColumn(['company_name', 'charged_amount']);
        });
    }
};
