<?php

namespace Database\Seeders;

use App\Models\WhatsAppGroup;
use Illuminate\Database\Seeder;

class WhatsAppGroupSeeder extends Seeder
{
    public function run(): void
    {
        $groups = [
            [
                'target_type' => 'class',
                'class_name' => 'X RPL 1',
                'group_name' => 'Paguyuban Ortu X RPL 1',
                'group_target_id' => '120363000000000001@g.us',
                'is_active' => true,
            ],
            [
                'target_type' => 'class',
                'class_name' => 'X TKJ 1',
                'group_name' => 'Paguyuban Ortu X TKJ 1',
                'group_target_id' => '120363000000000002@g.us',
                'is_active' => true,
            ],
            [
                'target_type' => 'class',
                'class_name' => 'XI RPL 1',
                'group_name' => 'Paguyuban Ortu XI RPL 1',
                'group_target_id' => '120363000000000003@g.us',
                'is_active' => true,
            ],
            [
                'target_type' => 'class',
                'class_name' => 'XI TKJ 1',
                'group_name' => 'Paguyuban Ortu XI TKJ 1',
                'group_target_id' => '120363000000000004@g.us',
                'is_active' => true,
            ],
            [
                'target_type' => 'class',
                'class_name' => 'XII RPL 1',
                'group_name' => 'Paguyuban Ortu XII RPL 1',
                'group_target_id' => '120363000000000005@g.us',
                'is_active' => true,
            ],
            [
                'target_type' => 'class',
                'class_name' => 'XII AKL 1',
                'group_name' => 'Paguyuban Ortu XII AKL 1',
                'group_target_id' => '120363000000000006@g.us',
                'is_active' => false,
            ],
            [
                'target_type' => 'teachers',
                'class_name' => null,
                'group_name' => 'Grup Guru & Staf SMKN 1 Gunung Agung',
                'group_target_id' => '120363000000000010@g.us',
                'is_active' => true,
            ],
            [
                'target_type' => 'all_parents',
                'class_name' => null,
                'group_name' => 'Informasi Umum Orang Tua/Wali',
                'group_target_id' => '120363000000000011@g.us',
                'is_active' => true,
            ],
        ];

        foreach ($groups as $group) {
            WhatsAppGroup::updateOrCreate(
                ['group_target_id' => $group['group_target_id']],
                $group
            );
        }
    }
}
