<?php
use App\Domains\CostUnit\Controllers\CreateController;
use App\Domains\CostUnit\Controllers\ListController;
use App\Domains\CostUnit\Controllers\OpenController;
use App\Domains\UserManagement\Controllers\EmailVerificationController;
use App\Domains\UserManagement\Controllers\LoginController;
use App\Domains\UserManagement\Controllers\LogOutController;
use App\Domains\UserManagement\Controllers\RegistrationController;
use App\Domains\UserManagement\Controllers\ResetPasswordController;
use App\Middleware\IdentifyTenant;
use Illuminate\Support\Facades\Route;

Route::middleware(IdentifyTenant::class)->group(function () {
    Route::prefix('cost-unit')->group(function () {
        Route::middleware(['auth'])->group(function () {
            Route::get('/create', [CreateController::class, 'showForm']);
            Route::get('/list', ListController::class);
            Route::get('/{costUnitId}/', OpenController::class);


        });



    });
    Route::get('/register', [RegistrationController::class, 'loginForm']);
    Route::get('/register/verifyEmail', [EmailVerificationController::class, 'verifyEmailForm']);

    Route::get('/reset-password', [ResetPasswordController::class, 'resetPasswordForm']);

    route::get('/logout', LogOutController::class);
    route::post('/login', [LoginController::class, 'doLogin']);
    route::get('/login', [LoginController::class, 'loginForm']);


});



