<?php

namespace Database\Factories;

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

/**
 * @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\CountryCallsReport>
 */
class CountryCallsReportFactory 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),
            'route_to_teh4' => $this->faker->numberBetween(10, 100),
            'route_to_teh5' => $this->faker->numberBetween(10, 100),
            'route_to_os4' => $this->faker->numberBetween(10, 100),
            'route_to_os5' => $this->faker->numberBetween(10, 100),
            'answered' => $this->faker->numberBetween(10, 100),
            'answered_over10' => $this->faker->numberBetween(10, 100),
            'missed' => $this->faker->numberBetween(10, 100),
            'dnd' => $this->faker->numberBetween(10, 100),
            'transferred' => $this->faker->numberBetween(10, 100),
            'talked_to_operator' => $this->faker->numberBetween(10, 100),
            'average_calls_time' => $this->faker->numberBetween(10, 100),
            'fails' => $this->faker->numberBetween(10, 100),
        ];
    }
}
