<?php

namespace Database\Seeders;

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

class RapBonusRuleSeeder extends Seeder
{
    /**
     * Run the database seeds.
     */
    public function run(): void
    {
        // Hapus data lama jika ada
        RapBonusRule::truncate();

        $rules = [
            [
                'nama_rule' => 'Bronze',
                'min_mahasiswa' => 5,
                'max_mahasiswa' => 9,
                'nominal_bonus' => 1000000,
                'is_active' => 'aktif',
                'urutan' => 1,
            ],
            [
                'nama_rule' => 'Silver',
                'min_mahasiswa' => 10,
                'max_mahasiswa' => 14,
                'nominal_bonus' => 1500000,
                'is_active' => 'aktif',
                'urutan' => 2,
            ],
            [
                'nama_rule' => 'Gold',
                'min_mahasiswa' => 15,
                'max_mahasiswa' => null,
                'nominal_bonus' => 3000000,
                'is_active' => 'aktif',
                'urutan' => 3,
            ],
        ];

        foreach ($rules as $rule) {
            RapBonusRule::create($rule);
        }

        $this->command->info('Bonus rules seeded successfully!');
    }
}
