<?php

namespace Database\Seeders;

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

class PlanSeeder extends Seeder
{
    public function run(): void
    {
        $plans = [
            ['name' => 'free',     'monthly_price_cents' => 0,     'workspace_limit' => 1,   'member_limit' => 1,   'custom_domain_limit' => 0,   'link_limit' => 50,     'click_limit_monthly' => 1000],
            ['name' => 'pro',      'monthly_price_cents' => 1900,  'workspace_limit' => 1,   'member_limit' => 3,   'custom_domain_limit' => 1,   'link_limit' => 1000,   'click_limit_monthly' => 25000],
            ['name' => 'business', 'monthly_price_cents' => 7900,  'workspace_limit' => 3,   'member_limit' => 10,  'custom_domain_limit' => 5,   'link_limit' => 10000,  'click_limit_monthly' => 250000],
            ['name' => 'agency',   'monthly_price_cents' => 19900, 'workspace_limit' => 999, 'member_limit' => 999, 'custom_domain_limit' => 999, 'link_limit' => 999999, 'click_limit_monthly' => 5000000],
        ];

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