<?php

declare(strict_types=1);

namespace Database\Factories;

use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Str;

/** @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Plan> */
class PlanFactory extends Factory
{
    /** @return array<string, mixed> */
    public function definition(): array
    {
        $name = fake()->unique()->words(2, true);

        return [
            'name' => ucwords($name),
            'slug' => Str::slug($name),
            'description' => fake()->sentence(),
            'service_type' => fake()->randomElement(['vps', 'dedicated', 'hosting', 'mysql', 'game', 'backups']),
            'price' => fake()->randomFloat(2, 5, 500),
            'currency' => 'USD',
            'billing_cycle' => fake()->randomElement(['monthly', 'quarterly', 'annual']),
            'features' => [
                'cpu' => fake()->numberBetween(1, 16).' vCPU',
                'ram' => fake()->randomElement(['1GB', '2GB', '4GB', '8GB', '16GB', '32GB']),
                'disk' => fake()->randomElement(['20GB', '50GB', '100GB', '200GB', '500GB']),
                'bandwidth' => fake()->randomElement(['1TB', '2TB', '5TB', '10TB', 'Unlimited']),
            ],
            'status' => 'active',
            'sort_order' => fake()->numberBetween(0, 100),
        ];
    }
}
