<?php

namespace Database\Factories;

use App\Enums\Gender;
use App\Models\UserProfile;
use Illuminate\Database\Eloquent\Factories\Factory;

/**
 * @extends Factory<UserProfile>
 */
class UserProfileFactory extends Factory
{
    protected $model = UserProfile::class;

    public function definition(): array
    {
        $gender = fake()->randomElement(Gender::cases());
        $faker = fake('id_ID');

        return [
            'full_name' => $faker->name($gender === Gender::Male ? 'male' : 'female'),
            'phone_number' => '08'.fake()->numerify('##########'),
            'address' => $faker->address(),
            'gender' => $gender,
            'birth_date' => fake()->dateTimeBetween('-55 years', '-18 years')->format('Y-m-d'),
            'birth_place' => $faker->city(),
        ];
    }
}
