<?php

use App\Http\Controllers\ExpositionController;
use App\Http\Controllers\GalleryController;
use App\Http\Controllers\SendDataController;
use App\Http\Controllers\PreloadController;
use App\Http\Controllers\SummaryController;
use App\Http\Controllers\WelcomeController;
use App\Http\Controllers\WorkController;
use App\Http\Middleware\CheckSessionExpiration;
use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider and all of them will
| be assigned to the "web" middleware group. Make something great!
|
*/

Route::get('/', [WelcomeController::class, 'view'])->name('welcome');
Route::post('/preload_data', [PreloadController::class, 'receiveData']);
Route::group(['middleware' => [CheckSessionExpiration::class]], function () {
    Route::get('/gallery_data', [GalleryController::class, 'view']);
    Route::post('/gallery_data', [GalleryController::class, 'store']);
    Route::get('/exposition_data', [ExpositionController::class, 'view']);
    Route::post('/exposition_data', [ExpositionController::class, 'store']);
    Route::get('/get_expositions', [ExpositionController::class, 'searchItgExpositions']);
    Route::get('/works_data', [WorkController::class, 'view']);
    Route::get('/get_works', [WorkController::class, 'searchItgWorks']);
    Route::get('/get_work_editions', [WorkController::class, 'searchItgWorkEditions']);
    Route::post('/map_works', [WorkController::class, 'mapWorks']);
    Route::get('/summary', [SummaryController::class, 'view']);
    Route::post('/accept_data', [SendDataController::class, 'acceptDataAction']);
});
