<?php

namespace Database\Seeders;

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

class TailorSpecializationSeeder extends Seeder
{
    public function run(): void
    {
        // Hapus data relasi terlebih dahulu
        DB::table('tailor_specialization_user')->truncate();
        
        // Hapus data spesialisasi
        DB::statement('SET FOREIGN_KEY_CHECKS=0;');
        DB::table('tailor_specializations')->truncate();
        DB::statement('SET FOREIGN_KEY_CHECKS=1;');
        
        $specializations = [
            // Gaya Busana
            ['name' => 'Casual', 'category' => 'Gaya Busana'],
            ['name' => 'Formal', 'category' => 'Gaya Busana'],
            ['name' => 'Tradisional', 'category' => 'Gaya Busana'],
            ['name' => 'Modern', 'category' => 'Gaya Busana'],
            
            // Jenis Layanan
            ['name' => 'Jahit Baru', 'category' => 'Jenis Layanan'],
            ['name' => 'Perbaikan', 'category' => 'Jenis Layanan'],
            ['name' => 'Design/Custom', 'category' => 'Jenis Layanan'],
            
            // Hiasan Busana
            ['name' => 'Border', 'category' => 'Hiasan Busana'],
            ['name' => 'Payet', 'category' => 'Hiasan Busana'],
            ['name' => 'Sulam', 'category' => 'Hiasan Busana']
        ];

        DB::table('tailor_specializations')->insert($specializations);
    }
} 