<?php

namespace App\Http\Controllers\API\V1\Admin;

use App\Http\Controllers\Controller;
use App\Models\Deposit;
use App\Models\AdminLog;
use App\Models\Trade;
use Illuminate\Http\Request;

class AdminController extends Controller
{
    public function dashboard()
    {
        return response()->json(['success' => true, 'data' => []]);
    }

    public function statistics()
    {
        return response()->json(['success' => true, 'data' => []]);
    }

    public function deposits()
    {
        $deposits = Deposit::with('user')->orderBy('created_at', 'desc')->paginate(20);
        return response()->json(['success' => true, 'data' => $deposits]);
    }

    public function pendingDeposits()
    {
        $deposits = Deposit::pending()->with('user')->orderBy('created_at', 'desc')->paginate(20);
        return response()->json(['success' => true, 'data' => $deposits]);
    }

    public function trades()
    {
        $trades = Trade::with(['user', 'asset'])->orderBy('created_at', 'desc')->paginate(20);
        return response()->json(['success' => true, 'data' => $trades]);
    }

    public function activeTrades()
    {
        $trades = Trade::where('status', 'active')->with(['user', 'asset'])->paginate(20);
        return response()->json(['success' => true, 'data' => $trades]);
    }

    public function logs()
    {
        $logs = AdminLog::with('user')->orderBy('created_at', 'desc')->paginate(50);
        return response()->json(['success' => true, 'data' => $logs]);
    }
}
