<?php

namespace Database\Seeders;

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

class KelompokTaniSeeder extends Seeder
{
    /**
     * Jalankan seeder kelompok tani.
     */
    public function run(): void
    {
        Schema::disableForeignKeyConstraints();
        DB::table('kelompok_tani')->truncate();
        Schema::enableForeignKeyConstraints();

        $poktans = [
            [
                'nomor_induk' => 'PK-001201',
                'nama_kelompok' => 'Tani Mulyo I',
                'nama_ketua' => 'Suroso',
                'nik_ketua' => '3321010203040001',
                'no_hp_ketua' => '08123456789',
                'regency_id' => 1,
                'district_id' => 10,
                'village_id' => 100,
                'alamat_spesifik' => 'Dusun Krajan RT 02/RW 01',
                'created_at' => now(),
                'updated_at' => now(),
            ],
            [
                'nomor_induk' => 'PK-001202',
                'nama_kelompok' => 'Suka Makmur II',
                'nama_ketua' => 'Slamet Basuki',
                'nik_ketua' => '3321040506070002',
                'no_hp_ketua' => '08134567890',
                'regency_id' => 1,
                'district_id' => 11,
                'village_id' => 110,
                'alamat_spesifik' => 'Jl. Sawah Blok B-4',
                'created_at' => now(),
                'updated_at' => now(),
            ],
            [
                'nomor_induk' => 'PK-002301',
                'nama_kelompok' => 'Tani Makmur Sindoro',
                'nama_ketua' => 'Widodo',
                'nik_ketua' => '3323010405060001',
                'no_hp_ketua' => '08156789012',
                'regency_id' => 2,
                'district_id' => 20,
                'village_id' => 200,
                'alamat_spesifik' => 'Lereng Sindoro Indah',
                'created_at' => now(),
                'updated_at' => now(),
            ],
            [
                'nomor_induk' => 'PK-002302',
                'nama_kelompok' => 'Sumbing Lestari',
                'nama_ketua' => 'Heri Santoso',
                'nik_ketua' => '3323050809100002',
                'no_hp_ketua' => '08190123456',
                'regency_id' => 2,
                'district_id' => 21,
                'village_id' => 210,
                'alamat_spesifik' => 'Jalan Argolawu No. 12',
                'created_at' => now(),
                'updated_at' => now(),
            ],
        ];

        DB::table('kelompok_tani')->insert($poktans);
    }
}