<?php

use App\Modules\Notification\Controllers\NotificationController;
use Illuminate\Support\Facades\Route;

Route::middleware(['auth:sanctum', 'tenant', 'feature:notification'])->group(function (): void {
    Route::middleware('company.permission:notification.view')->group(function (): void {
        Route::get('/notifications', [NotificationController::class, 'index']);
        Route::post('/notifications/read-all', [NotificationController::class, 'markAllRead']);
        Route::patch('/notifications/{notification}/read', [NotificationController::class, 'markRead']);
    });

    Route::post('/notifications', [NotificationController::class, 'store'])
        ->middleware('company.permission:notification.manage');
});
