<?php

namespace App\Http\Controllers;

use App\Services\AnalyticsService;
use Illuminate\View\View;

class MexcoSuperAdminAnalyticsController extends Controller
{
    public function __construct(private AnalyticsService $analytics) {}

    public function index(): View
    {
        $overview = $this->analytics->platformOverview();
        $eventsByPlan = $this->analytics->eventsByPlan();
        $revenueByMonth = $this->analytics->revenueByMonth();
        $topEvents = $this->analytics->topEventsByParticipants();

        return view('super-admin.analytics.index', compact(
            'overview',
            'eventsByPlan',
            'revenueByMonth',
            'topEvents',
        ));
    }
}
