<?php

namespace Database\Seeders;

use Illuminate\Database\Seeder;

class DatabaseSeeder extends Seeder
{
    /**
     * Seed the application's database.
     */
    public function run(): void
    {
        $this->call([
            // Core seeders (order matters due to dependencies)
            RolePermissionSeeder::class, // Creates system roles and permissions
            UserSeeder::class,
            ChartOfAccountSeeder::class,

            // Settings seeders
            CompanySettingSeeder::class,
            CurrencySeeder::class,
            TaxSeeder::class,
            BankAccountSeeder::class,
            SignatureSeeder::class,
            EmailTemplateSeeder::class,
            ReminderSystemSeeder::class,

            // Business data seeders
            CustomerSeeder::class,
            ProductSeeder::class,
            InvoiceSeeder::class,
            CreditNoteSeeder::class,
            EstimateSeeder::class,
            ExpenseSeeder::class,
            PaymentSeeder::class,
        ]);

        $this->command->info('');
        $this->command->info('✅ All demo data has been seeded successfully!');
        $this->command->info('');
        $this->command->info('Summary of seeded data:');
        $this->command->info('  • Roles & Permissions');
        $this->command->info('  • Users (Admin accounts)');
        $this->command->info('  • Chart of Accounts');
        $this->command->info('  • Company Settings');
        $this->command->info('  • 25 Currencies');
        $this->command->info('  • 25 Tax Rates + 22 Tax Groups');
        $this->command->info('  • 20 Bank Accounts');
        $this->command->info('  • 20 Signatures');
        $this->command->info('  • 20 Email Templates');
        $this->command->info('  • 25 Customers');
        $this->command->info('  • 5 demo low-stock + 5 demo out-of-stock products');
        $this->command->info('  • 25 Invoices with items');
        $this->command->info('  • Up to 5 demo credit notes (sales returns)');
        $this->command->info('  • 25 Estimates/Quotations with items');
        $this->command->info('  • 25 Expenses');
        $this->command->info('  • Payments (for paid/partial invoices)');
        $this->command->info('');
    }
}
