<?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('partner_profiles', function (Blueprint $table) {
            // Block new bookings (renewals of existing subscriptions still work)
            $table->boolean('suspend_new_bookings')->default(false)->after('is_available');
            $table->string('suspend_reason', 200)->nullable()->after('suspend_new_bookings');

            // KYC documents
            $table->string('aadhaar_number', 20)->nullable()->after('police_verified');
            $table->string('aadhaar_doc_path')->nullable()->after('aadhaar_number');
            $table->string('police_doc_path')->nullable()->after('aadhaar_doc_path');
            $table->timestamp('aadhaar_verified_at')->nullable()->after('police_doc_path');
            $table->timestamp('police_verified_at')->nullable()->after('aadhaar_verified_at');

            // Admin notes
            $table->text('admin_notes')->nullable()->after('police_verified_at');
        });
    }

    public function down(): void
    {
        Schema::table('partner_profiles', function (Blueprint $table) {
            $table->dropColumn([
                'suspend_new_bookings', 'suspend_reason',
                'aadhaar_number', 'aadhaar_doc_path', 'police_doc_path',
                'aadhaar_verified_at', 'police_verified_at', 'admin_notes',
            ]);
        });
    }
};

