<?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::create('phone_number_types', function (Blueprint $table) {
            $table->id();

            $table->string('name');
            $table->string('slug')->unique();

            $table->string('routing_strategy', 100)->nullable();
            $table->string('default_queue_type', 50)->nullable();

            $table->boolean('is_client_facing')->default(false);
            $table->boolean('is_default_outbound')->default(false);
            $table->boolean('auto_record')->default(true);

            $table->json('allowed_channels')->nullable();
            $table->json('meta')->nullable();

            $table->boolean('is_active')->default(true)->index();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('phone_number_types');
    }
};
