<?php

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

return new class extends Migration
{
    public function up(): void
    {
        Schema::table('vendor_profiles', function (Blueprint $table) {
            $table->string('upi_id')->nullable()->after('whatsapp_number');
            $table->string('upi_qr_code')->nullable()->after('upi_id');
            $table->string('bank_name')->nullable()->after('upi_qr_code');
            $table->string('account_number')->nullable()->after('bank_name');
            $table->string('ifsc_code')->nullable()->after('account_number');
            $table->string('account_holder_name')->nullable()->after('ifsc_code');
            $table->string('custom_razorpay_key')->nullable()->after('account_holder_name');
            $table->text('payment_instructions')->nullable()->after('custom_razorpay_key');
        });
    }

    public function down(): void
    {
        Schema::table('vendor_profiles', function (Blueprint $table) {
            $table->dropColumn([
                'upi_id',
                'upi_qr_code',
                'bank_name',
                'account_number',
                'ifsc_code',
                'account_holder_name',
                'custom_razorpay_key',
                'payment_instructions',
            ]);
        });
    }
};
