<?php

declare(strict_types=1);

namespace Plugins\Larablog\Membership\Database\Seeders;

use Illuminate\Database\Seeder;
use Plugins\Larablog\Membership\Models\MembershipPlan;

class MembershipPlanSeeder extends Seeder
{
    public function run(): void
    {
        MembershipPlan::query()->updateOrCreate(
            ['slug' => 'monthly'],
            [
                'name' => '月度会员',
                'description' => '30 天会员，可阅读会员可见文章。',
                'price' => '9.90',
                'currency' => 'CNY',
                'duration_days' => 30,
                'enabled' => true,
                'sort_order' => 10,
            ],
        );

        MembershipPlan::query()->updateOrCreate(
            ['slug' => 'lifetime'],
            [
                'name' => '终身会员',
                'description' => '一次购买，长期有效。',
                'price' => '99.00',
                'currency' => 'CNY',
                'duration_days' => null,
                'enabled' => true,
                'sort_order' => 20,
            ],
        );
    }
}
