<?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::create('licensing_legislation', function (Blueprint $table) {
            $table->id();
            $table->string('law_number', 50);
            $table->string('title');
            $table->text('description');
            $table->string('category', 50)->default('Investimento');
            $table->string('icon_name', 50)->default('Building2');
            $table->string('url')->nullable();
            $table->unsignedSmallInteger('sort_order')->default(0);
            $table->boolean('is_active')->default(true);
            $table->timestamps();
        });

        Schema::create('licensing_steps', function (Blueprint $table) {
            $table->id();
            $table->unsignedTinyInteger('step_number');
            $table->string('title');
            $table->text('description');
            $table->string('duration', 100)->nullable();
            $table->string('platform', 100)->nullable();
            $table->string('platform_url')->nullable();
            $table->unsignedSmallInteger('sort_order')->default(0);
            $table->boolean('is_active')->default(true);
            $table->timestamps();
        });

        Schema::create('licensing_checklist', function (Blueprint $table) {
            $table->id();
            $table->string('item_text');
            $table->unsignedSmallInteger('sort_order')->default(0);
            $table->boolean('is_active')->default(true);
            $table->timestamps();
        });
    }

    public function down(): void
    {
        Schema::dropIfExists('licensing_checklist');
        Schema::dropIfExists('licensing_steps');
        Schema::dropIfExists('licensing_legislation');
    }
};
