<?php

namespace Database\Seeders;

use Illuminate\Database\Seeder;

class CompleteIceCreamSystemSeeder extends Seeder
{
    /**
     * Seed the complete ice cream POS system
     *
     * This master seeder runs all related seeders in the correct order:
     * 1. Container products (Small, Medium, Family)
     * 2. Ice cream recipes and ingredients
     */
    public function run(): void
    {
        $this->command->info('');
        $this->command->info('╔════════════════════════════════════════════════════════════╗');
        $this->command->info('║  🍦 COMPLETE ICE CREAM POS SYSTEM SEEDER                  ║');
        $this->command->info('╚════════════════════════════════════════════════════════════╝');
        $this->command->info('');
        $this->command->info('This will seed:');
        $this->command->info('  ✓ Ice cream container products (Small, Medium, Family)');
        $this->command->info('  ✓ 25 ingredients with realistic costs');
        $this->command->info('  ✓ 10 ice cream products (flavours)');
        $this->command->info('  ✓ 10 complete recipes');
        $this->command->info('');
        $this->command->info('════════════════════════════════════════════════════════════');
        $this->command->info('');

        // Step 1: Seed container products
        $this->command->info('📦 STEP 1/2: Seeding container products...');
        $this->command->info('');
        $this->call(IceCreamContainerProductsSeeder::class);

        // Step 2: Seed recipes and ingredients
        $this->command->info('📦 STEP 2/2: Seeding recipes and ingredients...');
        $this->command->info('');
        $this->call(IceCreamRecipesTestSeeder::class);

        // Final summary
        $this->command->info('');
        $this->command->info('╔════════════════════════════════════════════════════════════╗');
        $this->command->info('║  ✅ COMPLETE SYSTEM SEEDED SUCCESSFULLY!                  ║');
        $this->command->info('╚════════════════════════════════════════════════════════════╝');
        $this->command->info('');
        $this->command->info('📊 Database Summary:');
        $this->command->info('  • Container Products: 3 (Small, Medium, Family)');
        $this->command->info('  • Ice Cream Flavours: 10');
        $this->command->info('  • Ingredients: 25');
        $this->command->info('  • Recipes: 10');
        $this->command->info('  • Scoop Weight Configs: 6 (1-6 scoops)');
        $this->command->info('');
        $this->command->info('🧪 Quick Test Commands:');
        $this->command->info('');
        $this->command->info('  # View container products');
        $this->command->info('  php artisan tinker');
        $this->command->info('  >>> \\App\\Models\\Product::where(\'has_inner_options\', true)->get([\'name\', \'price\', \'scoop_capacity\']);');
        $this->command->info('');
        $this->command->info('  # Test weight calculation');
        $this->command->info('  >>> $service = app(\\App\\Services\\ScoopWeightService::class);');
        $this->command->info('  >>> $service->getWeightEfficiencyReport();');
        $this->command->info('');
        $this->command->info('  # View all ice cream flavours');
        $this->command->info('  >>> \\App\\Models\\Product::whereHas(\'category\', fn($q) => $q->where(\'name\', \'like\', \'%Ice Cream%\'))->pluck(\'name\');');
        $this->command->info('');
        $this->command->info('════════════════════════════════════════════════════════════');
        $this->command->info('');
        $this->command->info('📚 Documentation:');
        $this->command->info('  • QUICK_START_GUIDE.md - Get started in 5 minutes');
        $this->command->info('  • USE_CASES_SCENARIOS.md - Real-world POS examples');
        $this->command->info('  • COMPREHENSIVE_TEST_GUIDE.md - Testing procedures');
        $this->command->info('');
        $this->command->info('🎯 System ready for testing!');
        $this->command->info('');
    }
}
