<?php

namespace Database\Seeders;

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

class PlanSeeder extends Seeder
{
    public function run(): void
    {
        $plans = [
            [
                'role_type' => 'member',
                'name' => 'Member Bronze (30 Hari)',
                'price' => 50000,
                'duration_days' => 30,
                'features_json' => ['search_limit' => 10, 'detail_view' => true]
            ],
            [
                'role_type' => 'leasing',
                'name' => 'Leasing Startup (90 Hari)',
                'price' => 1500000,
                'duration_days' => 90,
                'features_json' => ['record_limit' => 1000, 'import_excel' => true]
            ],
        ];

        foreach ($plans as $plan) {
            Plan::updateOrCreate(['name' => $plan['name']], $plan);
        }
    }
}
