<?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('plans', function (Blueprint $table) {
            $table->boolean('show_contact_details')->default(false)->after('is_active');
            $table->boolean('view_buyer_contact')->default(false)->after('show_contact_details');
            $table->boolean('is_featured')->default(false)->after('view_buyer_contact');
            $table->boolean('has_verified_badge')->default(false)->after('is_featured');
            $table->boolean('allow_microsite')->default(false)->after('has_verified_badge');
            $table->decimal('commission_rate', 5, 2)->default(0.00)->after('allow_microsite');
        });
    }

    public function down(): void
    {
        Schema::table('plans', function (Blueprint $table) {
            $table->dropColumn([
                'show_contact_details',
                'view_buyer_contact',
                'is_featured',
                'has_verified_badge',
                'allow_microsite',
                'commission_rate'
            ]);
        });
    }
};
