<?php

namespace Database\Seeders;

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

class PricingPlanSeeder extends Seeder
{
    public function run(): void
    {
        $defaults = config('dewemoji.pricing.defaults', []);
        foreach ($defaults as $plan) {
            PricingPlan::updateOrCreate(
                ['code' => $plan['code']],
                [
                    'name' => $plan['name'],
                    'currency' => $plan['currency'],
                    'amount' => $plan['amount'],
                    'period' => $plan['period'],
                    'status' => $plan['status'],
                    'meta' => $plan['meta'] ?? null,
                ]
            );
        }
    }
}
