<?php

namespace Database\Factories;

use App\Models\Admin;
use App\Models\ScheduledReport;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Str;

/** @extends Factory<ScheduledReport> */
class ScheduledReportFactory extends Factory
{
    protected $model = ScheduledReport::class;

    public function definition(): array
    {
        return [
            'uuid' => (string) Str::uuid(),
            'report_name' => fake()->sentence(3),
            'report_type' => 'executive',
            'module' => 'executive',
            'frequency' => 'weekly',
            'recipients' => json_encode([fake()->safeEmail()], JSON_THROW_ON_ERROR),
            'format' => 'pdf',
            'filters' => ['date_range' => 'last_7_days'],
            'timezone' => 'Asia/Kolkata',
            'created_by' => Admin::factory(),
            'next_run' => now()->addWeek(),
            'status' => 'active',
        ];
    }
}
