<?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) {
            // Marketing / highlight card fields
            $table->string('highlight_brand_name', 150)
                  ->nullable()
                  ->after('plan_eful_code')
                  ->comment('Brand name shown on highlight card e.g. EFU Cashless Health Plus');

            $table->decimal('highlight_starting_price', 12, 2)
                  ->nullable()
                  ->after('highlight_brand_name')
                  ->comment('Starting from price shown on highlight card (PKR)');

            $table->json('highlight_features')
                  ->nullable()
                  ->after('highlight_starting_price')
                  ->comment('Array of bullet-point feature strings for the highlight/marketing card');
        });
    }

    public function down(): void
    {
        Schema::table('plans', function (Blueprint $table) {
            $table->dropColumn(['highlight_brand_name', 'highlight_starting_price', 'highlight_features']);
        });
    }
};