<?php

namespace Database\Seeders;

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

class DivisionsSeeder extends Seeder
{
    public function run()
    {
        $now = Carbon::now();
        
        $divisions = [
            [
                'code' => 'FN',
                'name' => 'Family Class and Non-Economic Class',
                'description' => 'Family sponsorship, refugees, protected persons, and humanitarian and compassionate considerations.',
                'order' => 1,
                'active' => true
            ],
            [
                'code' => 'CM',
                'name' => 'Canadian Citizenship and Multiple Status Holders',
                'description' => 'Citizenship applications, dual citizenship, and multiple status holders.',
                'order' => 2,
                'active' => true
            ],
            [
                'code' => 'LRI',
                'name' => 'Legal Research and Immigration Legislation',
                'description' => 'Immigration and Refugee Protection Act, regulations, and legal research methodologies.',
                'order' => 3,
                'active' => true
            ],
            [
                'code' => 'BML',
                'name' => 'Business, Ministerial and Legislative Framework',
                'description' => 'Business immigration, ministerial instructions, and legislative framework.',
                'order' => 4,
                'active' => true
            ],
            [
                'code' => 'IRBAT',
                'name' => 'IRB, Appeals, Tribunals and Judicial Review',
                'description' => 'Immigration and Refugee Board, appeals processes, and judicial review procedures.',
                'order' => 5,
                'active' => true
            ],
            [
                'code' => 'PRO',
                'name' => 'Procedures',
                'description' => 'Immigration procedures, application processes, and administrative requirements.',
                'order' => 6,
                'active' => true
            ],
            [
                'code' => 'CC',
                'name' => 'Criminal Law, Immigration Consequences',
                'description' => 'Criminal inadmissibility, rehabilitation, and criminal law consequences for immigration.',
                'order' => 7,
                'active' => true
            ],
            [
                'code' => 'CCA',
                'name' => 'Consultants, Counsel, Authorized Representatives',
                'description' => 'Professional conduct, authorized representatives, and consultant regulations.',
                'order' => 8,
                'active' => true
            ],
            [
                'code' => 'CTPS-EBP',
                'name' => 'Compliance, Temporary Permits, Sponsor Bars, Enforcement, Border Protocols',
                'description' => 'Compliance requirements, temporary permits, sponsorship bars, enforcement measures, and border procedures.',
                'order' => 9,
                'active' => true
            ],
        ];

        foreach ($divisions as $division) {
            DB::table('divisions')->insert(array_merge($division, [
                'created_at' => $now,
                'updated_at' => $now,
            ]));
        }

        $this->command->info('✅ Divisions seeded successfully! (9 records)');
    }
}
