<?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('plans', function (Blueprint $table) {
            $table->id();
            $table->string('name', 64);
            $table->unsignedBigInteger('price_monthly');      // USD cents (3500 = $35)
            $table->unsignedBigInteger('price_monthly_iqd');  // whole dinars (50000)
            $table->unsignedSmallInteger('trial_days')->default(14);
            $table->json('limits'); // {dentists, staff, wa_messages_month, storage_gb}
            $table->string('paddle_price_id', 190)->nullable();
            $table->boolean('is_active')->default(true);
            $table->timestamps();
        });
    }

    public function down(): void
    {
        Schema::dropIfExists('plans');
    }
};
