<?php

use App\Http\Controllers\AddonController;
use App\Http\Controllers\AvailabilityRuleController;
use App\Http\Controllers\Bookings\BookingCalendarController;
use App\Http\Controllers\Bookings\BookingController;
use App\Http\Controllers\BookingPriceAdjustmentController;
use App\Http\Controllers\Bookings\RoomAvailabilityController;
use App\Http\Controllers\Bookings\ChannelManagerController;
use App\Http\Controllers\CurrencyController;
use App\Http\Controllers\ExchangeRateController;
use App\Http\Controllers\FacilityController;
use App\Http\Controllers\ImageController;
use App\Http\Controllers\ImageManageController;
use App\Http\Controllers\MealPackageController;
use App\Http\Controllers\PriceModifierController;
use App\Http\Controllers\PriceSettingController;
use App\Http\Controllers\RoomCategoryController;
use App\Http\Controllers\RoomController;
use App\Http\Controllers\SettingController;
use App\Http\Controllers\SiteInfoController;
use Illuminate\Support\Facades\Route;
use Inertia\Inertia;
use Laravel\Fortify\Features;

// ------------------------------------------------------------------> Still dev

Route::get('/room', function () {
    return Inertia::render('home/room');
})->name('room');
Route::get('/details', function () {
    return Inertia::render('details');
})->name('details');

Route::get('/confirm', function () {
    return Inertia::render('confirm');
})->name('confirm');



// ------------------------------------------------------------------> Admin side
Route::middleware(['auth', 'verified', 'dashboard'])->group(function () {

    Route::get('dashboard', function () {
        return Inertia::render('dashboard');
    })->name('dashboard');

    // Route::post('dashboard/images/upload', [ImageController::class, 'upload']);

    Route::patch('dashboard/bookings/{id}/status', [BookingController::class, 'updateStatus']);
    Route::resource('dashboard/bookings', BookingController::class);


    Route::resource('dashboard/images', ImageController::class);
    Route::resource('dashboard/room-categories', RoomCategoryController::class);
    Route::resource('dashboard/rooms', RoomController::class);
    Route::resource('dashboard/price-modifiers', PriceModifierController::class);

    Route::resource('dashboard/meal-packages', MealPackageController::class);
    Route::resource('dashboard/add-ons', AddonController::class);
    Route::resource('dashboard/availability-rules', AvailabilityRuleController::class);
    Route::resource('dashboard/facilities', FacilityController::class);

    Route::resource('dashboard/settings', SettingController::class);
    Route::get('dashboard/currency-settings/rates', [CurrencyController::class, 'rates']);
    Route::resource('dashboard/currency-settings', CurrencyController::class);

    Route::get('dashboard/exchange-rates/add-record', [ExchangeRateController::class, 'addRecord']);
    Route::resource('dashboard/exchange-rates', ExchangeRateController::class);

    Route::put('dashboard/price-settings/room/{id}', [PriceSettingController::class, 'updateRoom']);
    Route::put('dashboard/price-settings/category/{id}', [PriceSettingController::class, 'updateCategory']);
    Route::resource('dashboard/price-settings', PriceSettingController::class);
    Route::resource('dashboard/price-adjustment', BookingPriceAdjustmentController::class);

    Route::resource('dashboard/booking-calendar', BookingCalendarController::class);
    Route::resource('dashboard/room-availability', RoomAvailabilityController::class);
    Route::resource('dashboard/channel-manager', ChannelManagerController::class);

    Route::resource('dashboard/image-manage', ImageManageController::class);

    Route::get('dashboard/site-info/contact', [SiteInfoController::class, 'editContact'])->name('site-info.contact.edit');
    Route::put('dashboard/site-info/contact', [SiteInfoController::class, 'updateContact'])->name('site-info.contact.update');

    Route::get('dashboard/site-info/social-links', [SiteInfoController::class, 'editSocialLinks'])->name('site-info.social-links.edit');
    Route::put('dashboard/site-info/social-links', [SiteInfoController::class, 'updateSocialLinks'])->name('site-info.social-links.update');
});

require __DIR__ . '/settings.php';
require __DIR__ . '/client.php';
