<?php

namespace Database\Seeders;

use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;

class ReportSeeder extends Seeder
{
    /**
     * Run the database seeder.
     */
    public function run(): void
    {
        // Create sample reports manually
        DB::table('reports')->insert([
            [
                'name' => 'Q1 Revenue Analysis',
                'type' => 'revenue',
                'data' => json_encode([
                    'total_revenue' => 125000.50,
                    'monthly_revenue' => [
                        '2025-01' => 15000,
                        '2025-02' => 18000,
                        '2025-03' => 22000,
                    ],
                    'service_revenue' => [
                        'Oil Change' => 8500,
                        'Brake Repair' => 15000,
                        'Engine Repair' => 35000,
                    ]
                ]),
                'filters' => json_encode([
                    'date_from' => '2025-01-01',
                    'date_to' => '2025-03-31',
                ]),
                'generated_at' => now(),
                'generated_by' => 1,
                'created_at' => now(),
                'updated_at' => now(),
            ],
            [
                'name' => 'Customer Analytics Report',
                'type' => 'customer',
                'data' => json_encode([
                    'total_customers' => 542,
                    'new_customers' => 47,
                    'retention_rate' => 78.5,
                    'customer_segments' => [
                        'new' => 47,
                        'regular' => 385,
                        'vip' => 110,
                    ]
                ]),
                'filters' => json_encode([
                    'date_from' => '2025-01-01',
                    'date_to' => '2025-06-30',
                ]),
                'generated_at' => now(),
                'generated_by' => 1,
                'created_at' => now(),
                'updated_at' => now(),
            ],
        ]);
    }
}
