<?php
namespace Modules\Product\Database\Seeders;
use Illuminate\Database\Seeder;
use Modules\Product\Models\Product;

class ProductDatabaseSeeder extends Seeder
{
    public function run(): void
    {
        $products = [
            [
                'name' => 'Organic Bananas',
                'slug' => 'organic-bananas',
                'description' => 'Fresh organic bananas sourced from sustainable farms.',
                'price' => 2.99,
                'unit' => 'bunch',
                'unit_price' => 0.30,
                'nutri_score' => 'A',
                'tags' => ['organic', 'fruit', 'fresh'],
                'category_id' => 1,
                'is_active' => true,
                'is_save_the_food' => false,
                'is_weekly_special' => true,
                'discount' => 10.00,
                'original_price' => 3.32,
            ],
            [
                'name' => 'Sourdough Bread',
                'slug' => 'sourdough-bread',
                'description' => 'Artisan sourdough bread baked fresh daily.',
                'price' => 5.49,
                'unit' => 'loaf',
                'unit_price' => null,

                'nutri_score' => 'B',
                'tags' => ['bakery', 'artisan', 'fresh'],
                'category_id' => 2,
                'is_active' => true,
                'is_save_the_food' => false,
                'is_weekly_special' => false,
            ],
            [
                'name' => 'Almond Milk 1L',
                'slug' => 'almond-milk-1l',
                'description' => 'Unsweetened almond milk, perfect for cereals and coffee.',
                'price' => 3.29,
                'unit' => 'carton',
                'unit_price' => null,

                'nutri_score' => 'A',
                'tags' => ['dairy-alternative', 'vegan', 'plant-based'],
                'category_id' => 3,
                'is_active' => true,
                'is_save_the_food' => false,
                'is_weekly_special' => true,
                'discount' => 15.00,
                'original_price' => 3.87,
            ],
            [
                'name' => 'Mixed Salad Box',
                'slug' => 'mixed-salad-box',
                'description' => 'Pre-washed mixed salad greens. Near expiry - great discount!',
                'price' => 1.99,
                'unit' => 'box',
                'unit_price' => null,

                'nutri_score' => 'A',
                'tags' => ['salad', 'fresh', 'save-the-food'],
                'category_id' => 1,
                'is_active' => true,
                'is_save_the_food' => true,
                'is_weekly_special' => false,
                'discount' => 50.00,
                'original_price' => 3.99,
            ],
            [
                'name' => 'Free-Range Eggs (6pk)',
                'slug' => 'free-range-eggs-6pk',
                'description' => 'Pasture-raised free-range eggs from local farm.',
                'price' => 4.99,
                'unit' => 'pack',
                'unit_price' => 0.83,
                'nutri_score' => 'A',
                'tags' => ['eggs', 'free-range', 'protein'],
                'category_id' => 4,
                'is_active' => true,
                'is_save_the_food' => false,
                'is_weekly_special' => false,
            ],
            [
                'name' => 'Greek Yogurt 500g',
                'slug' => 'greek-yogurt-500g',
                'description' => 'Creamy plain Greek yogurt, high in protein.',
                'price' => 5.99,
                'unit' => 'tub',
                'unit_price' => null,
                'nutri_score' => 'B',
                'tags' => ['dairy', 'yogurt', 'protein'],
                'category_id' => 3,
                'is_active' => true,
                'is_save_the_food' => true,
                'is_weekly_special' => false,
                'discount' => 30.00,
                'original_price' => 8.56,
            ],
            [
                'name' => 'Dark Chocolate 70%',
                'slug' => 'dark-chocolate-70',
                'description' => 'Belgian dark chocolate with 70% cocoa content.',
                'price' => 3.99,
                'unit' => 'bar',
                'unit_price' => null,
                'nutri_score' => 'C',
                'tags' => ['chocolate', 'snack', 'belgian'],
                'category_id' => 5,
                'is_active' => true,
                'is_save_the_food' => false,
                'is_weekly_special' => false,
            ],
            [
                'name' => 'Sparkling Water 6pk',
                'slug' => 'sparkling-water-6pk',
                'description' => 'Natural sparkling mineral water, no added sugar.',
                'price' => 4.49,
                'unit' => 'pack',
                'unit_price' => 0.75,
                'nutri_score' => 'A',
                'tags' => ['water', 'beverage', 'zero-sugar'],
                'category_id' => 6,
                'is_active' => true,
                'is_save_the_food' => false,
                'is_weekly_special' => false,
            ],
            [
                'name' => 'Ripe Avocados (2pk)',
                'slug' => 'ripe-avocados-2pk',
                'description' => 'Perfectly ripe avocados ready to eat today!',
                'price' => 2.49,
                'unit' => 'pack',
                'unit_price' => 1.25,
                'nutri_score' => 'A',
                'tags' => ['avocado', 'fruit', 'save-the-food'],
                'category_id' => 1,
                'is_active' => true,
                'is_save_the_food' => true,
                'is_weekly_special' => false,
                'discount' => 40.00,
                'original_price' => 4.15,
            ],
            [
                'name' => 'Organic Chicken Breast 500g',
                'slug' => 'organic-chicken-breast-500g',
                'description' => 'Organic free-range chicken breast fillet.',
                'price' => 8.99,
                'unit' => 'pack',
                'unit_price' => 17.98,
                'nutri_score' => 'B',
                'tags' => ['meat', 'organic', 'protein'],
                'category_id' => 7,
                'is_active' => true,
                'is_save_the_food' => false,
                'is_weekly_special' => false,
            ],
        ];

        foreach ($products as $product) {
            Product::create($product);
        }
    }
}
