<?php

/*
|--------------------------------------------------------------------------
| Module Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for this module.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the Closure to execute when that URI is requested.
|
*/


Route::get('beta', [\App\Modules\Dashboard_v2\controllers\DashboardViewController::class, 'beta']);
Route::group(['prefix' => Config::get('app.api_path'), 'middleware' => ['web', 'auth']], function () {
    Route::get('dashboard2/summary/{id}', [\App\Modules\Dashboard_v2\controllers\api\v1\DashboardControllerREST::class, 'getSummary']);
    Route::get('dashboard2/tasks', [\App\Modules\Dashboard_v2\controllers\api\v1\DashboardControllerREST::class, 'getTasks']);
    Route::get('dashboard2/stats', [\App\Modules\Dashboard_v2\controllers\api\v1\DashboardControllerREST::class, 'getStats']);
    Route::get('dashboard2/repairs-leaderboard', [\App\Modules\Dashboard_v2\controllers\api\v1\DashboardControllerREST::class, 'getRepairsLeaderboard']);
    Route::get('dashboard2/pie-chart-stats', [\App\Modules\Dashboard_v2\controllers\api\v1\DashboardControllerREST::class, 'getPieChartStats']);
    Route::get('dashboard2/repairs-summary', [\App\Modules\Dashboard_v2\controllers\api\v1\DashboardControllerREST::class, 'getRepairsSummary']);
    Route::get('dashboard2/support-summary', [\App\Modules\Dashboard_v2\controllers\api\v1\DashboardControllerREST::class, 'getSupportSummary']);
    Route::get('dashboard2/onsite-summary', [\App\Modules\Dashboard_v2\controllers\api\v1\DashboardControllerREST::class, 'getOnsiteSummary']);
    Route::get('dashboard2/completed-summary', [\App\Modules\Dashboard_v2\controllers\api\v1\DashboardControllerREST::class, 'getCompletedSummary']);
    Route::get('dashboard2/orders-summary', [\App\Modules\Dashboard_v2\controllers\api\v1\DashboardControllerREST::class, 'getOrdersSummary']);
    Route::get('dashboard2/sale-lead-summary', [\App\Modules\Dashboard_v2\controllers\api\v1\DashboardControllerREST::class, 'getSaleLeadSummary']);
    Route::get('dashboard2/projects-summary', [\App\Modules\Dashboard_v2\controllers\api\v1\DashboardControllerREST::class, 'getProjectsSummary']);
    Route::get('dashboard2/rma-summary', [\App\Modules\Dashboard_v2\controllers\api\v1\DashboardControllerREST::class, 'getRmaSummary']);
});

/*
|--------------------------------------------------------------------------
| Pages rendered on the server
|--------------------------------------------------------------------------
|
| This group routes are pages rendered on the server.
| All the pages require the user to be authentificated.
|
*/

Route::group(['middleware' => ['web', 'auth']], function () {
    Route::get('dashboard', [\App\Modules\Dashboard_v2\controllers\DashboardController::class, 'getIndex']);
});
