<?php

namespace Database\Factories;

use App\Models\Group;
use App\Models\Import;
use Illuminate\Database\Eloquent\Factories\Factory;

class ImportFactory extends Factory
{
    /**
     * The name of the factory's corresponding model.
     *
     * @var string
     */
    protected $model = Import::class;

    /**
     * Define the model's default state.
     *
     * @return array
     */
    public function definition()
    {
        return [
            'group_id' => optional(Group::inRandomOrder()->first())->id,
            'registered_at' => $this->faker->date(),
            'title' => $this->faker->text(300),
            'country' => $this->faker->country,
            'unit' => $this->faker->randomElement(['кг', 'дкл', 'шт', 'компл']),
            'price' => $this->faker->randomNumber(),
            'currency' => $this->faker->randomElement(['Евро', 'Туркменский манат', 'Доллар США'])
        ];
    }
}
