<?php

use App\Domains\Dashboard\Controllers\DashboardController;
use App\Http\Controllers\EventCodeGetController;
use App\Http\Controllers\GiroCodeGetController;
use App\Http\Controllers\TestRenderInertiaProvider;
use App\Middleware\IdentifyTenant;
use App\Providers\CronController;
use App\Providers\CronTaskHandleProvider;
use App\Providers\GlobalDataProvider;
use Illuminate\Support\Facades\Route;


require_once __DIR__ . '/../app/Domains/Dashboard/Routes/web.php';
require_once __DIR__ . '/../app/Domains/Dashboard/Routes/api.php';
require_once __DIR__ . '/../app/Domains/UserManagement/Routes/web.php';
require_once __DIR__ . '/../app/Domains/UserManagement/Routes/api.php';
require_once __DIR__ . '/../app/Domains/CostUnit/Routes/web.php';
require_once __DIR__ . '/../app/Domains/CostUnit/Routes/api.php';
require_once __DIR__ . '/../app/Domains/Invoice/Routes/web.php';
require_once __DIR__ . '/../app/Domains/Invoice/Routes/api.php';
require_once __DIR__ . '/../app/Domains/Event/Routes/web.php';
require_once __DIR__ . '/../app/Domains/Event/Routes/api.php';
require_once __DIR__ . '/../app/Domains/Budget/Routes/web.php';
require_once __DIR__ . '/../app/Domains/Budget/Routes/api.php';
require_once __DIR__ . '/../app/Domains/Legal/Routes/web.php';
require_once __DIR__ . '/../app/Domains/Admin/Routes/web.php';
require_once __DIR__ . '/../app/Domains/Admin/Routes/api.php';


Route::get('/LKvDUqWl', function () {
    return redirect('/event/LKvDUqWl');
});

Route::get('/LKvDUqWl/', function () {
    return redirect('/event/LKvDUqWl');
});

Route::get('/execute-crons', [CronTaskHandleProvider::class, 'run']);
Route::get('/print-girocode/{participantToken}', GiroCodeGetController::class);
Route::get('/print-event-code/{eventToken}', EventCodeGetController::class);

Route::middleware(IdentifyTenant::class)->group(function () {
    Route::get('/', DashboardController::class);
    Route::prefix('api/v1/core') ->group(function () {
        Route::get('/retrieve-global-data', GlobalDataProvider::class);
        Route::get('/retrieve-text-resource/{textResource}', [GlobalDataProvider::class, 'getTextResourceText']);
        Route::get('/retrieve-messages', [GlobalDataProvider::class, 'getMessages']);
        Route::get('/retrieve-invoice-types', [GlobalDataProvider::class, 'getInvoiceTypes']);
        Route::get('/retrieve-invoice-types-all', [GlobalDataProvider::class, 'getAllInvoiceTypes']);
        Route::get('/retrieve-event-setting-data', [GlobalDataProvider::class, 'getEventSettingData']);

    });
});



