<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/
use Modules\HR\Http\Controllers\EmployeeController;

Route::prefix('report')->group(function () {
    Route::get('/', 'ReportController@index');
    Route::post('/', 'ReportController@store')->name('report.store');
    Route::get('/edit/{id}', 'ReportController@edit')->name('report.edit');
    Route::get('/show/{id}', 'ReportController@show')->name('report.show');
    Route::get('/delete/{id}', 'ReportController@delete')->name('report.delete');
    Route::post('/update/{id}', 'ReportController@update')->name('report.update');
    Route::get('/get-fte-report/{userId}', 'UserReportController@getFteData')->name('reports.fte.get-report-data');
    Route::get('get-codetrek-report', 'CodeTrekController@getApplicantData')->name('reports.codetrek.get-report-data');

    Route::prefix('finance')->group(function () {
        Route::get('dashboard', 'FinanceReportController@dashboard')->name('reports.finance.dashboard');
        Route::get('get-report-data', 'FinanceReportController@getReportData')->name('reports.finance.get-report-data');

        Route::prefix('profit-and-loss')->group(function () {
            Route::get('/', 'ProfitAndLossReportController@index')->name('reports.finance.profit-and-loss.index');
            Route::get('/detailed', 'ProfitAndLossReportController@detailed')->name('reports.finance.profit-and-loss.detailed');
            Route::get('profit-and-loss-report-export', 'ProfitAndLossReportController@profitAndLossReportExport')->name('reports.finance.profit-and-loss.report.export');
        });

        Route::prefix('revenue-by-client')->group(function () {
            Route::get('/', 'FinanceReportController@index')->name('reports.finance.revenue-by-client.index');
            Route::get('/dashboard/client-wise', 'FinanceReportController@clientWiseInvoiceDashboard')->name('reports.finance.dashboard.client');
            Route::get('/detailed', 'ClientRevenueReportController@detailed')->name('reports.finance.revenue-by-client.detailed');
            Route::get('client-revenue-report-export', 'ClientRevenueReportController@clientRevenueReportExport')->name('reports.finance.client-revenue.report.export');
        });

        Route::prefix('employee')->group(function () {
            Route::get('/profitibality', [EmployeeController::class, 'index'])->name('report.employees.profitibality');
        });

        Route::prefix('monthly-sales-register')->group(function () {
            Route::get('/', 'MonthlySalesRegisterController@index')->name('reports.finance.monthly-sales-register.index');
            Route::get('/export', 'MonthlySalesRegisterController@exportReport')->name('reports.finance.monthly-sales-register.export');
        });

        Route::get('/project-contract-list', 'ContractReportController@index')->name('report.project.contracts.index');
    });
});
