<?php

namespace Database\Factories;

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

/**
 * @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\CountryMessageRatingReport>
 */
class CountryMessageRatingReportFactory 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(100, 1000),
            'listens' => $this->faker->numberBetween(10, 100),
            'not_listens' => $this->faker->numberBetween(10, 100),
            'review_average' => $this->faker->numberBetween(10, 100),
            'action1' => $this->faker->numberBetween(10, 100),
            'action2' => $this->faker->numberBetween(10, 100),
            'action3' => $this->faker->numberBetween(10, 100),
            'action4' => $this->faker->numberBetween(10, 100),
            'action5' => $this->faker->numberBetween(10, 100),
        ];
    }
}
