<?php

namespace Database\Factories;

use App\Models\Province;
use Illuminate\Database\Eloquent\Factories\Factory;

/**
 * @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\CountryKeypressReport>
 */
class CountryKeypressReportFactory extends Factory
{
    /**
     * Define the model's default state.
     *
     * @return array<string, mixed>
     */
    public function definition(): array
    {
//        $this->faker->randomElement(Province::all()->pluck('id')->toArray())
        return [
            'province_id' => Province::factory(),
            'province_name' => function (array $attributes) {
                return Province::query()->find($attributes['province_id'])->name;
            },
            'date' => $this->faker->date(),
            'total' => $this->faker->numberBetween(1000, 10000),
            'key1' => $this->faker->numberBetween(10, 100),
            'key2' => $this->faker->numberBetween(10, 100),
            'key3' => $this->faker->numberBetween(10, 100),
            'key4' => $this->faker->numberBetween(10, 100),
            'key5' => $this->faker->numberBetween(10, 100),
            'key6' => $this->faker->numberBetween(10, 100),
            'key9' => $this->faker->numberBetween(10, 100),
            'key4_1' => $this->faker->numberBetween(10, 100),
            'key4_2' => $this->faker->numberBetween(10, 100),
            'key5_1' => $this->faker->numberBetween(10, 100),
            'key5_2' => $this->faker->numberBetween(10, 100),
            'key2_1' => $this->faker->numberBetween(10, 100),
            'key2_2' => $this->faker->numberBetween(10, 100),
            'key2_3' => $this->faker->numberBetween(10, 100),
        ];
    }
}
