<?php

namespace Database\Factories;

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

/**
 * @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\CountryVoiceRatingReport>
 */
class CountryVoiceRatingReportFactory 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(),
            'message_quality_ok' => $this->faker->numberBetween(10, 100),
            'message_format_ok' => $this->faker->numberBetween(10, 100),
            'message_quality_nok' => $this->faker->numberBetween(10, 100),
            'message_format_nok' => $this->faker->numberBetween(10, 100),
        ];
    }
}
