<?php

namespace Database\Seeders;

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

class SectorSeeder extends Seeder
{
    public function run(): void
    {
        DB::statement('SET FOREIGN_KEY_CHECKS=0;');
        DB::table('sectors')->truncate();
        DB::statement('SET FOREIGN_KEY_CHECKS=1;');

        $sectors = [
            [
                'slug'       => 'manufacturing',
                'name_en'    => 'Manufacturing',
                'name_ar'    => 'التصنيع',
                'sort_order' => 1,
                'is_active'  => true,
                'created_at' => now(),
                'updated_at' => now(),
            ],
            [
                'slug'       => 'trading',
                'name_en'    => 'Trading & Retail',
                'name_ar'    => 'التجارة والتجزئة',
                'sort_order' => 2,
                'is_active'  => true,
                'created_at' => now(),
                'updated_at' => now(),
            ],
            [
                'slug'       => 'services',
                'name_en'    => 'Services & Clinics',
                'name_ar'    => 'الخدمات والعيادات',
                'sort_order' => 3,
                'is_active'  => true,
                'created_at' => now(),
                'updated_at' => now(),
            ],
            [
                'slug'       => 'hospitality',
                'name_en'    => 'Hospitality & F&B',
                'name_ar'    => 'الضيافة والمطاعم',
                'sort_order' => 4,
                'is_active'  => true,
                'created_at' => now(),
                'updated_at' => now(),
            ],
            [
                'slug'       => 'real_estate',
                'name_en'    => 'Real Estate & Construction',
                'name_ar'    => 'العقارات والمقاولات',
                'sort_order' => 5,
                'is_active'  => true,
                'created_at' => now(),
                'updated_at' => now(),
            ],
            [
                'slug'       => 'startups',
                'name_en'    => 'Startups & Tech',
                'name_ar'    => 'الشركات الناشئة والتكنولوجيا',
                'sort_order' => 6,
                'is_active'  => true,
                'created_at' => now(),
                'updated_at' => now(),
            ],
            [
                'slug'       => 'healthcare',
                'name_en'    => 'Healthcare',
                'name_ar'    => 'الرعاية الصحية',
                'sort_order' => 7,
                'is_active'  => true,
                'created_at' => now(),
                'updated_at' => now(),
            ],
            [
                'slug'       => 'education',
                'name_en'    => 'Education',
                'name_ar'    => 'التعليم',
                'sort_order' => 8,
                'is_active'  => true,
                'created_at' => now(),
                'updated_at' => now(),
            ],
            [
                'slug'       => 'fmcg',
                'name_en'    => 'FMCG',
                'name_ar'    => 'السلع سريعة الاستهلاك',
                'sort_order' => 9,
                'is_active'  => true,
                'created_at' => now(),
                'updated_at' => now(),
            ],
            [
                'slug'       => 'logistics',
                'name_en'    => 'Logistics & Supply Chain',
                'name_ar'    => 'اللوجستيات وسلسلة التوريد',
                'sort_order' => 10,
                'is_active'  => true,
                'created_at' => now(),
                'updated_at' => now(),
            ],
            [
                'slug'       => 'other',
                'name_en'    => 'Other',
                'name_ar'    => 'أخرى',
                'sort_order' => 99,
                'is_active'  => true,
                'created_at' => now(),
                'updated_at' => now(),
            ],
        ];

        DB::table('sectors')->insert($sectors);

        $this->command->info('✅ Sectors seeded: ' . count($sectors) . ' sectors');
    }
}