<?php

use App\Http\Controllers\User\AccountController;
use App\Http\Controllers\User\AnnouncementController;
use App\Http\Controllers\User\BinaryTreeController;
use App\Http\Controllers\User\DashboardController;
use App\Http\Controllers\User\IncomeController;
use App\Http\Controllers\User\KycController;
use App\Http\Controllers\User\NotificationController;
use App\Http\Controllers\User\PlanController;
use App\Http\Controllers\User\RankController;
use App\Http\Controllers\User\ReferralController;
use App\Http\Controllers\User\ReportController;
use App\Http\Controllers\User\ShopController;
use App\Http\Controllers\User\SupportController;
use App\Http\Controllers\User\TeamController;
use App\Http\Controllers\User\UpiController;
use App\Http\Controllers\User\WalletController;
use App\Http\Controllers\User\WithdrawalController;
use Illuminate\Support\Facades\Route;

Route::prefix('user')->name('user.')->middleware(['auth', 'role:user'])->group(function () {
    Route::get('/dashboard', [DashboardController::class, 'index'])->name('dashboard');
    Route::get('/dashboard/metrics', [DashboardController::class, 'metrics'])->name('dashboard.metrics');
    Route::get('/wallet', [WalletController::class, 'index'])->name('wallet');
    Route::post('/wallet/transfer', [WalletController::class, 'transfer'])->name('wallet.transfer');
    Route::get('/income', [IncomeController::class, 'index'])->name('income');
    Route::get('/team', [TeamController::class, 'index'])->name('team');
    Route::get('/binary-tree', [BinaryTreeController::class, 'index'])->name('binary-tree');
    Route::get('/tree', [BinaryTreeController::class, 'index'])->name('tree');
    Route::get('/referrals', [ReferralController::class, 'index'])->name('referrals');
    Route::get('/reports', [ReportController::class, 'index'])->name('reports');
    Route::get('/reports/income', [ReportController::class, 'income'])->name('reports.income');
    Route::get('/reports/payouts', [ReportController::class, 'payouts'])->name('reports.payouts');
    Route::get('/reports/orders', [ReportController::class, 'orders'])->name('reports.orders');
    Route::get('/reports/yearly', [ReportController::class, 'yearly'])->name('reports.yearly');
    Route::get('/shop', [ShopController::class, 'index'])->name('shop');
    Route::get('/withdrawals', [WithdrawalController::class, 'index'])->name('withdrawals');
    Route::post('/withdrawals/otp', [WithdrawalController::class, 'sendOtp'])->name('withdrawals.otp');
    Route::post('/withdrawals', [WithdrawalController::class, 'store'])->name('withdrawals.store');
    Route::get('/notifications', [NotificationController::class, 'index'])->name('notifications');
    Route::post('/notifications/read', [NotificationController::class, 'markRead'])->name('notifications.read');
    Route::get('/kyc', [KycController::class, 'index'])->name('kyc');
    Route::post('/kyc', [KycController::class, 'store'])->name('kyc.store');
    Route::get('/account', [AccountController::class, 'index'])->name('account');
    Route::get('/profile', [AccountController::class, 'index'])->name('profile');
    Route::post('/profile/preferences', [AccountController::class, 'updatePreferences'])->name('profile.preferences');
    Route::get('/upi', [UpiController::class, 'index'])->name('upi');
    Route::post('/upi', [UpiController::class, 'store'])->name('upi.store');
    Route::get('/plans', [PlanController::class, 'index'])->name('plans');
    Route::get('/rank', [RankController::class, 'index'])->name('rank');
    Route::get('/support', [SupportController::class, 'index'])->name('support');
    Route::get('/announcements', [AnnouncementController::class, 'index'])->name('announcements');
});
