<?php

namespace Database\Factories;

use App\Models\Pet;
use App\Models\PetPhoto;
use Database\Factories\Concerns\CopiesSeederImages;
use Illuminate\Database\Eloquent\Factories\Factory;

/**
 * @extends Factory<PetPhoto>
 */
class PetPhotoFactory extends Factory
{
    use CopiesSeederImages;

    /**
     * Define the model's default state.
     *
     * @return array<string, mixed>
     */
    public function definition(): array
    {
        return [
            'pet_id' => Pet::factory(),
            'file_path' => $this->copyRandomSeederImage('pet_samples', 'pets'),
            'display_order' => fake()->numberBetween(0, 10),
        ];
    }

    public function first(): static
    {
        return $this->state(fn (array $attributes) => [
            'display_order' => 0,
        ]);
    }
}
