<?php

use App\Http\Controllers\Portal\NotificationController;
use App\Http\Controllers\Staff\DashboardController;
use App\Http\Controllers\Staff\LibraryController;
use App\Http\Controllers\Staff\MessageController;
use Illuminate\Support\Facades\Route;

Route::middleware(['auth', 'role:Librarian|Front Desk|Super Admin|Administrator'])
    ->prefix('staff')
    ->name('staff.')
    ->group(function () {
        Route::get('/', [DashboardController::class, 'index'])->name('dashboard');

        Route::get('library', [LibraryController::class, 'index'])->name('library.index');

        Route::get('messages', [MessageController::class, 'index'])->name('messages.index');
        Route::get('messages/create', [MessageController::class, 'create'])->name('messages.create');
        Route::post('messages', [MessageController::class, 'store'])->name('messages.store');
        Route::get('messages/inbox/{messageRecipient}', [MessageController::class, 'show'])->name('messages.show');

        Route::get('notifications', [NotificationController::class, 'index'])->name('notifications.index');
        Route::post('notifications/{id}/read', [NotificationController::class, 'markRead'])->name('notifications.read');
        Route::post('notifications/read-all', [NotificationController::class, 'markAllRead'])->name('notifications.read-all');
    });
