<?php

namespace App\Http\Controllers\Admin;

use App\Models\Business;
use App\Models\UnlockOrder;
use Illuminate\Http\Request;
use Inertia\Inertia;

class AdminDashboardController extends Controller
{
    public function index()
    {
        $totalShops = Business::count();
        $totalOrders = UnlockOrder::count();
        $pendingOrders = UnlockOrder::where('status', 'pending')->count();
        $todayIncome = UnlockOrder::whereDate('created_at', today())->count() * 100; // assume 100 per order

        return Inertia::render('Admin/Dashboard', [
            'stats' => [
                'total_shops' => $totalShops,
                'total_orders' => $totalOrders,
                'pending_orders' => $pendingOrders,
                'today_income' => $todayIncome,
            ],
        ]);
    }
}