<?php

namespace Database\Seeders;

use Illuminate\Database\Seeder;
use App\Models\Report;

class StandardReportsSeeder extends Seeder
{
    public function run()
    {
        $reports = [
            [
                'name' => 'Sales Performance',
                'module' => 'leads',
                'selected_columns' => ['id', 'full_name', 'lead_source', 'lead_status', 'created_at'],
                'chart_type' => 'bar',
                'is_public' => true,
                'user_id' => 1
            ],
            [
                'name' => 'Inventory Status',
                'module' => 'properties',
                'selected_columns' => ['id', 'plot_number', 'property_type', 'status', 'base_price'],
                'chart_type' => 'pie',
                'is_public' => true,
                'user_id' => 1
            ],
            [
                'name' => 'Financial Collection',
                'module' => 'invoices',
                'selected_columns' => ['id', 'invoice_number', 'amount', 'status', 'due_date'],
                'chart_type' => 'line',
                'is_public' => true,
                'user_id' => 1
            ],
            [
                'name' => 'Agent Activity',
                'module' => 'agents',
                'selected_columns' => ['id', 'user_id', 'department', 'status'],
                'chart_type' => 'bar',
                'is_public' => true,
                'user_id' => 1
            ]
        ];

        foreach ($reports as $r) {
            Report::updateOrCreate(['name' => $r['name']], $r);
        }
    }
}
