<?php

namespace Database\Seeders;

use Illuminate\Database\Seeder;
use Illuminate\Database\Eloquent\Model;

class DatabaseSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        Model::unguard();

        $this->command->info('🌱 Starting Seraph3 Database Seeding...');
        
        // Seed in order of dependencies
        $this->call(SettingsSeeder::class);
        $this->call(UsersTableSeeder::class);
        $this->call(ClientsCustomersSeeder::class);
        $this->call(TasksBookingsSeeder::class);
        $this->call(StockInvoicesSeeder::class);
        $this->call(HRSeeder::class);
        $this->call(ProjectsSeeder::class);
        $this->call(NotificationsSeeder::class);
        $this->call(ChatSeeder::class);
        $this->call(TemplatesSeeder::class);
        $this->call(PartsSeeder::class);
        $this->call(TaskSubtypesSeeder::class);
        
        $this->command->info('✅ Database seeding completed successfully!');
        $this->command->info('');
        $this->command->info('🔐 Default Login Credentials:');
        $this->command->info('   Username: admin');
        $this->command->info('   Password: admin123');
        $this->command->info('');
        $this->command->info('📊 Test Data Created:');
        $this->command->info('   • Users with different roles and permissions');
        $this->command->info('   • Business clients with sites and contacts');
        $this->command->info('   • Individual customers');
        $this->command->info('   • Service tasks (repairs, support, onsite)');
        $this->command->info('   • Stock inventory with realistic pricing');
        $this->command->info('   • Sample invoices and quotes');

        Model::reguard();
    }
}
