<?php

declare(strict_types=1);

namespace Database\Factories;

use App\Models\Department;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Str;

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

    /** @return array<string, mixed> */
    public function definition(): array
    {
        $name = fake()->unique()->randomElement(['Billing', 'Technical', 'Sales', 'General', 'Abuse', 'Network']);

        return [
            'name' => $name,
            'slug' => Str::slug($name),
            'email' => fake()->optional()->safeEmail(),
            'auto_assign_to' => null,
            'sla_policy_id' => null,
            'sort_order' => fake()->numberBetween(0, 10),
        ];
    }
}
