<?php

use App\Http\Controllers\ProfileController;
use Illuminate\Support\Facades\Route;
use App\Http\Controllers\RolesPermissions\RolePermissionController;
use App\Http\Controllers\BookingController;
use App\Http\Controllers\AdminController;
use App\Http\Controllers\Masters\ClientController;
use App\Http\Controllers\Masters\SalesPocController;
use App\Http\Controllers\Masters\OpsPocController;
use App\Http\Controllers\Masters\ServicesTypeController;
use App\Http\Controllers\Masters\HotelVendorController;
use App\Http\Controllers\Masters\LandVendorController;


/*
|--------------------------------------------------------------------------
| 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('/', function () {
    return view('welcome');
});

Route::get('/dashboard', function () {
    return view('dashboard');
})->middleware(['auth', 'verified'])->name('dashboard');

Route::middleware('auth')->group(function () {
    Route::get('/profile', [ProfileController::class, 'edit'])->name('profile.edit');
    Route::patch('/profile', [ProfileController::class, 'update'])->name('profile.update');
    Route::delete('/profile', [ProfileController::class, 'destroy'])->name('profile.destroy');
});

Route::get('role', [RolePermissionController::class, 'index'])->name('role');

Route::middleware(['auth'])->group(function(){
    Route::get('admin/dashboard', [AdminController::class, 'index'])->name('admin/dashboard');
});

Route::get('booking', [BookingController::class, 'index'])->name('booking');
Route::get('booking/create', [BookingController::class, 'create'])->name('booking/create');
Route::post('booking/store', [BookingController::class, 'store'])->name('booking/store');
Route::get('booking/show/{id?}', [BookingController::class, 'show'])->name('booking/show');
Route::get('booking/edit/{id?}', [BookingController::class, 'edit'])->name('booking/edit');
Route::post('booking/update', [BookingController::class, 'update'])->name('booking/update');
Route::post('booking/delete', [BookingController::class, 'destroy'])->name('booking/delete');

// client routes
Route::get('client', [ClientController::class, 'index'])->name('client');
Route::get('client/create', [ClientController::class, 'create'])->name('client/create');
Route::post('client/store', [ClientController::class, 'store'])->name('client/store');
Route::get('client/show/{id?}', [ClientController::class, 'show'])->name('client/show');
Route::get('client/edit/{id?}', [ClientController::class, 'edit'])->name('client/edit');
Route::post('client/update', [ClientController::class, 'update'])->name('client/update');
Route::post('client/delete', [ClientController::class, 'destroy'])->name('client/delete');
// sales poc routes
Route::get('sales/poc', [SalesPocController::class, 'index'])->name('sales/poc');
Route::get('sales/poc/create', [SalesPocController::class, 'create'])->name('sales/poc/create');
Route::post('sales/poc/store', [SalesPocController::class, 'store'])->name('sales/poc/store');
Route::get('sales/poc/show/{id?}', [SalesPocController::class, 'show'])->name('sales/poc/show');
Route::get('sales/poc/edit/{id?}', [SalesPocController::class, 'edit'])->name('sales/poc/edit');
Route::post('sales/poc/update', [SalesPocController::class, 'update'])->name('sales/poc/update');
Route::post('sales/poc/delete', [SalesPocController::class, 'destroy'])->name('sales/poc/delete');
// POS POC routes
Route::get('ops/poc', [OpsPocController::class, 'index'])->name('ops/poc');
Route::get('ops/poc/create', [OpsPocController::class, 'create'])->name('ops/poc/create');
Route::post('ops/poc/store', [OpsPocController::class, 'store'])->name('ops/poc/store');
Route::get('ops/poc/show/{id?}', [OpsPocController::class, 'show'])->name('ops/poc/show');
Route::get('ops/poc/edit/{id?}', [OpsPocController::class, 'edit'])->name('ops/poc/edit');
Route::post('ops/poc/update', [OpsPocController::class, 'update'])->name('ops/poc/update');
Route::post('ops/poc/delete', [OpsPocController::class, 'destroy'])->name('ops/poc/delete');
// services type routes
Route::get('services/type', [ServicesTypeController::class, 'index'])->name('services/type');
Route::get('services/type/create', [ServicesTypeController::class, 'create'])->name('services/type/create');
Route::post('services/type/store', [ServicesTypeController::class, 'store'])->name('services/type/store');
Route::get('services/type/show/{id?}', [ServicesTypeController::class, 'show'])->name('services/type/show');
Route::get('services/type/edit/{id?}', [ServicesTypeController::class, 'edit'])->name('services/type/edit');
Route::post('services/type/update', [ServicesTypeController::class, 'update'])->name('services/type/update');
Route::post('services/type/delete', [ServicesTypeController::class, 'destroy'])->name('services/type/delete');
// hotel vendor
Route::get('hotel/vendor', [HotelVendorController::class, 'index'])->name('hotel/vendor');
Route::get('hotel/vendor/create', [HotelVendorController::class, 'create'])->name('hotel/vendor/create');
Route::post('hotel/vendor/store', [HotelVendorController::class, 'store'])->name('hotel/vendor/store');
Route::get('hotel/vendor/show/{id?}', [HotelVendorController::class, 'show'])->name('hotel/vendor/show');
Route::get('hotel/vendor/edit/{id?}', [HotelVendorController::class, 'edit'])->name('hotel/vendor/edit');
Route::post('hotel/vendor/update', [HotelVendorController::class, 'update'])->name('hotel/vendor/update');
Route::post('hotel/vendor/delete', [HotelVendorController::class, 'destroy'])->name('hotel/vendor/delete');
// land vendor
Route::get('land/vendor', [LandVendorController::class, 'index'])->name('land/vendor');
Route::get('land/vendor/create', [LandVendorController::class, 'create'])->name('land/vendor/create');
Route::post('land/vendor/store', [LandVendorController::class, 'store'])->name('land/vendor/store');
Route::get('land/vendor/show/{id?}', [LandVendorController::class, 'show'])->name('land/vendor/show');
Route::get('land/vendor/edit/{id?}', [LandVendorController::class, 'edit'])->name('land/vendor/edit');
Route::post('land/vendor/update', [LandVendorController::class, 'update'])->name('land/vendor/update');
Route::post('land/vendor/delete', [LandVendorController::class, 'destroy'])->name('land/vendor/delete');
require __DIR__.'/auth.php';
