<?php

namespace Database\Seeders;

use Illuminate\Database\Seeder;

class DatabaseSeeder extends Seeder
{
    // ══════════════════════════════════════════════════════════════
    //  InPractice — Master Seeder
    //
    //  Runs all seeders in the correct order.
    //  Order matters — hubs and sectors must exist
    //  before any cases or forum posts reference them.
    //
    //  To run all seeders:
    //    php artisan db:seed
    //
    //  To run a single seeder:
    //    php artisan db:seed --class=HubSeeder
    //
    //  To fresh migrate AND seed in one command:
    //    php artisan migrate:fresh --seed
    // ══════════════════════════════════════════════════════════════

    public function run(): void
    {
        $this->command->info('');
        $this->command->info('🚀 Seeding InPractice database...');
        $this->command->info('');

        // ── Step 1: Platform structure ─────────────────────────
        // Must run first — everything else depends on these
        $this->call([
            HubSeeder::class,
            SectorSeeder::class,
        ]);

        // ── Step 2: Admin account ──────────────────────────────
        $this->call([
            AdminSeeder::class,
        ]);

        $this->command->info('');
        $this->command->info('✅ All seeders completed successfully.');
        $this->command->info('');
        $this->command->info('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━');
        $this->command->info('  InPractice is ready.');
        $this->command->info('  Admin login: admin@inpractice.app');
        $this->command->info('  Password:    Admin@InPractice2025!');
        $this->command->warn('  Remember to change your password!');
        $this->command->info('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━');
        $this->command->info('');
    }
}
