<?php

namespace Database\Factories;

use App\Enums\StudentStatus;
use App\Models\Department;
use App\Models\Student;
use Illuminate\Database\Eloquent\Factories\Factory;

/**
 * @extends Factory<Student>
 */
class StudentFactory extends Factory
{
    protected $model = Student::class;

    public function definition(): array
    {
        return [
            'student_number' => fake()->unique()->numerify('########'),
            'department_id' => fn () => Department::query()->inRandomOrder()->value('id'),
            'enrollment_year' => fake()->numberBetween(now()->year - 4, now()->year),
            'academic_advisor_id' => null,
            'status' => StudentStatus::Active,
        ];
    }
}
