<?php

use App\Http\Controllers\PagesController;
use App\Http\Controllers\RoleController;
use App\Http\Controllers\GenModelController;
use Illuminate\Support\Facades\Route;
use App\Models\ConfServerLicense;

use App\Http\Controllers\HomeController;
use App\Http\Controllers\UserController;
use App\Http\Controllers\GroupController;
use App\Http\Controllers\CompanyController;
use App\Http\Controllers\ConfigOptionController;
use App\Http\Controllers\ExchangeRateController;
use App\Http\Controllers\ConsigneeController;
use App\Http\Controllers\ConvertToJsonController;
use App\Http\Controllers\DeletePatchController;
use App\Http\Controllers\DischargePortController;
use App\Http\Controllers\FormatFileMasterContrller;
use App\Http\Controllers\MasterFileController;
use App\Http\Controllers\NewsController;
use App\Http\Controllers\ParameterController;
use App\Http\Controllers\PatchController;
use App\Http\Controllers\ReportController;
use App\Http\Controllers\SelectListController;
use App\Http\Controllers\SendPatchController;
use App\Http\Controllers\ServerLicenseController;
use App\Http\Controllers\TestController;
use App\Http\Controllers\TransferDataController;
use App\Http\Livewire\MainContainer;
use App\Http\Livewire\Pages\Patch\PatchIndex;
use App\Http\Livewire\Pages\Role\RoleIndex;
use App\Http\Livewire\Pages\SendPatch\SendPatch;
use App\Http\Controllers\ManualResponse\ManualResponseController;
/*
|--------------------------------------------------------------------------
| 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!
|
*/


Route::get('/transfer-user', [TransferDataController::class, 'transferUserData']);
Route::middleware('guest')->group(function () {
    Route::get('/login', [\App\Http\Controllers\AuthController::class, 'loginView'])->name('loginView');
    Route::post('/login', [\App\Http\Controllers\AuthController::class, 'login'])->name('login');
    Route::get('/register', [\App\Http\Controllers\AuthController::class, 'registerView'])->name('registerView');
    Route::post('/register', [\App\Http\Controllers\AuthController::class, 'register'])->name('register');
});

Route::middleware(['auth' ])->group(function () {
    Route::post('/logout', [\App\Http\Controllers\AuthController::class, 'logout'])->name('logout');
    Route::get('/convert-to-json', [ConvertToJsonController::class, 'convert']);
    Route::get('/', [HomeController::class, 'index'])->name('index');
    Route::get('/get-serverlicense',  [ServerLicenseController::class, 'getAllServerKey']);

    Route::get('/patch',  [PatchController::class, 'index'])->name('patch.index');
    Route::get('/patch/edit/{editPid}', \App\Http\Livewire\Pages\Patch\PatchEdit::class)->name('patch.edit');


    Route::get('/master-file',  [MasterFileController::class, 'index'])->name('master-file.index');
    Route::post('/masterfile/create', [MasterFileController::class, 'createPatch'])->name('patch.master-file.create');

    
    Route::get('/format-file-master',  [FormatFileMasterContrller::class, 'index'])->name('format-file-master.index');
    Route::get('/send-patch',  [SendPatchController::class, 'index']);
    Route::get('/send-multi-patch',  [SendPatchController::class, 'indexMulti']);
    Route::get('/delete-multi-patch',  [DeletePatchController::class, 'indexMulti']);
    Route::get('/server-license',  [ServerLicenseController::class, 'index'])->name('server-license.index');

    Route::get('/user', [UserController::class, 'index'])->name('user.index');
    Route::get('/company', [CompanyController::class, 'index'])->name('company.index');
    Route::get('/group',  [GroupController::class, 'index'])->name('group.index');
    Route::get('/role',  [RoleController::class, 'index'])->name('role.index');
    Route::get('/news',  [NewsController::class, 'index'])->name('news.index');
    Route::get('/report',  [ReportController::class, 'index']);
    Route::get('/test',  [TestController::class, 'index']);


    Route::get('/exchange-rate',  [ExchangeRateController::class, 'index']);
    Route::get('/patch-exchange-rate',  [ExchangeRateController::class, 'creatPatch']);
    Route::get('/parameter',  [ParameterController::class, 'index']);
    Route::get('/discharge-port',  [DischargePortController::class, 'index']);


    Route::get('/get-users',  [SelectListController::class, 'getUsers']);
    Route::get('/get-roles',  [SelectListController::class, 'getRoles']);
    Route::get('/get-groups', [SelectListController::class, 'getGroups']);

    Route::get('/manual-response/index', [ManualResponseController::class, 'index'])->name('manual-response/index');

    /*
    |--------------------------------------------------------------------------
    Route::get('role', [RoleController::class ,'index'])->name('role-index');
    Route::get('/role', [RoleIndex::class])->name('role-index');
    Route::get('/generateModels', [GenModelController::class, 'generateModels']);
    
    |--------------------------------------------------------------------------
*/
});
