<?php

namespace Database\Seeders;

use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Str;

class FeatureOptionsSeeder extends Seeder
{
    public function run(): void
    {
        $featureOptions = [
            // Color Options
            [
                'name' => 'Red',
                'slug' => 'red',
                'description' => 'Classic red color option',
                'price_adjustment' => 0,
                'price_adjustment_type' => 'fixed',
                'is_active' => true,
                'sort_order' => 1,
            ],
            [
                'name' => 'Blue',
                'slug' => 'blue',
                'description' => 'Classic blue color option',
                'price_adjustment' => 0,
                'price_adjustment_type' => 'fixed',
                'is_active' => true,
                'sort_order' => 2,
            ],
            [
                'name' => 'Green',
                'slug' => 'green',
                'description' => 'Eco-friendly green color option',
                'price_adjustment' => 5.00,
                'price_adjustment_type' => 'fixed',
                'is_active' => true,
                'sort_order' => 3,
            ],
            [
                'name' => 'Black',
                'slug' => 'black',
                'description' => 'Premium black color option',
                'price_adjustment' => 10.00,
                'price_adjustment_type' => 'fixed',
                'is_active' => true,
                'sort_order' => 4,
            ],
            
            // Size Options
            [
                'name' => 'Small',
                'slug' => 'small',
                'description' => 'Compact small size',
                'price_adjustment' => 0,
                'price_adjustment_type' => 'fixed',
                'is_active' => true,
                'sort_order' => 1,
            ],
            [
                'name' => 'Medium',
                'slug' => 'medium',
                'description' => 'Standard medium size',
                'price_adjustment' => 15.00,
                'price_adjustment_type' => 'fixed',
                'is_active' => true,
                'sort_order' => 2,
            ],
            [
                'name' => 'Large',
                'slug' => 'large',
                'description' => 'Spacious large size',
                'price_adjustment' => 30.00,
                'price_adjustment_type' => 'fixed',
                'is_active' => true,
                'sort_order' => 3,
            ],
            
            // Material Quality Options
            [
                'name' => 'Standard',
                'slug' => 'standard',
                'description' => 'Standard material quality',
                'price_adjustment' => 0,
                'price_adjustment_type' => 'fixed',
                'is_active' => true,
                'sort_order' => 1,
            ],
            [
                'name' => 'Premium',
                'slug' => 'premium',
                'description' => 'High-quality premium material',
                'price_adjustment' => 25.00,
                'price_adjustment_type' => 'fixed',
                'is_active' => true,
                'sort_order' => 2,
            ],
            [
                'name' => 'Luxury',
                'slug' => 'luxury',
                'description' => 'Top-tier luxury material',
                'price_adjustment' => 50.00,
                'price_adjustment_type' => 'fixed',
                'is_active' => true,
                'sort_order' => 3,
            ],
            
            // Additional Features
            [
                'name' => 'Express Delivery',
                'slug' => 'express-delivery',
                'description' => 'Fast express delivery option',
                'price_adjustment' => 20.00,
                'price_adjustment_type' => 'fixed',
                'is_active' => true,
                'sort_order' => 1,
            ],
            [
                'name' => 'Gift Wrapping',
                'slug' => 'gift-wrapping',
                'description' => 'Premium gift wrapping service',
                'price_adjustment' => 5.00,
                'price_adjustment_type' => 'fixed',
                'is_active' => true,
                'sort_order' => 2,
            ],
            [
                'name' => 'Insurance',
                'slug' => 'insurance',
                'description' => 'Shipping insurance protection',
                'price_adjustment' => 10.00,
                'price_adjustment_type' => 'percentage',
                'is_active' => true,
                'sort_order' => 3,
            ],
        ];

        foreach ($featureOptions as $featureOption) {
            DB::table('feature_options')->insert(array_merge($featureOption, [
                'id' => (string) Str::uuid(),
                'created_at' => now(),
                'updated_at' => now(),
            ]));
        }
    }
}
