<?php

namespace Database\Factories;

use App\Enums\RoleSlug;
use App\Models\Role;
use Illuminate\Database\Eloquent\Factories\Factory;

/**
 * @extends Factory<Role>
 */
class RoleFactory extends Factory
{
    /**
     * @return array<string, mixed>
     */
    public function definition(): array
    {
        return [
            'name' => RoleSlug::Manager->label(),
            'slug' => RoleSlug::Manager,
            'description' => RoleSlug::Manager->description(),
        ];
    }

    public function admin(): static
    {
        return $this->state(fn (array $attributes): array => [
            'name' => RoleSlug::Admin->label(),
            'slug' => RoleSlug::Admin,
            'description' => RoleSlug::Admin->description(),
        ]);
    }

    public function manager(): static
    {
        return $this->state(fn (array $attributes): array => [
            'name' => RoleSlug::Manager->label(),
            'slug' => RoleSlug::Manager,
            'description' => RoleSlug::Manager->description(),
        ]);
    }
}
