<?php

namespace Database\Seeders;

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

class GroupSeeder extends Seeder
{
    /**
     * Seed tiga grup dasar sistem (RPD §6).
     */
    public function run(): void
    {
        $groups = [
            ['name' => Group::ADMIN, 'description' => 'Administrator — kelola seluruh data sistem.'],
            ['name' => Group::MEMBERS, 'description' => 'Member (Pengiklan) — beli credit & kelola campaign sendiri.'],
            ['name' => Group::DEVELOPER, 'description' => 'Developer — akses konfigurasi & pemeliharaan sistem.'],
        ];

        foreach ($groups as $group) {
            Group::firstOrCreate(['name' => $group['name']], $group);
        }
    }
}
