<?php

namespace Database\Factories;

use App\Models\Group;
use App\Models\User;
use Illuminate\Database\Eloquent\Factories\Factory;

/**
 * @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Group>
 */
class GroupFactory extends Factory
{
    protected $model = Group::class;

    /**
     * Define the model's default state.
     *
     * @return array<string, mixed>
     */
    public function definition(): array
    {
        $colors = [
            '#246bfd', // Blue
            '#10b981', // Emerald green
            '#f59e0b', // Amber
            '#ef4444', // Red
            '#8b5cf6', // Violet
            '#ec4899', // Pink
            '#06b6d4', // Cyan
            '#6366f1', // Indigo
            '#14b8a6', // Teal
            '#f97316', // Orange
        ];

        $groupNames = [
            'VIP Customers',
            'Marketing Leads',
            'Wholesale Buyers',
            'Retail Clients',
            'Newsletter Subscribers',
            'Tech Support',
            'Event Attendees',
            'Internal Staff',
            'Suppliers & Vendors',
            'Promo Offers',
            'Active Members',
            'Corporate Clients',
            'Emergency Contacts',
            'Service Subscribers',
        ];

        return [
            'user_id' => User::query()->value('id') ?? 1,
            'name' => fake()->randomElement($groupNames) . ' ' . fake()->unique()->numberBetween(100, 999),
            'description' => fake()->sentence(8),
            'color' => fake()->randomElement($colors),
        ];
    }
}
