<?php

use App\Modules\HR\Performance\Controllers\PerformanceController;
use Illuminate\Support\Facades\Route;

Route::prefix('hr/performance')->name('hr.performance.')->middleware(['module:hr', 'can:performance.view'])->group(function (): void {
    Route::get('/cycles', [PerformanceController::class, 'cycles'])->name('cycles.index');
    Route::post('/cycles', [PerformanceController::class, 'storeCycle'])->middleware('can:performance.create')->name('cycles.store');
    Route::put('/cycles/{cycle}', [PerformanceController::class, 'updateCycle'])->middleware('can:performance.update')->name('cycles.update');
    Route::delete('/cycles/{cycle}', [PerformanceController::class, 'destroyCycle'])->middleware('can:performance.manage')->name('cycles.destroy');
    Route::get('/reviews', [PerformanceController::class, 'reviews'])->name('reviews.index');
    Route::post('/reviews', [PerformanceController::class, 'storeReview'])->middleware('can:performance.create')->name('reviews.store');
    Route::put('/reviews/{review}/manager', [PerformanceController::class, 'managerUpdate'])->middleware('can:performance.manage')->name('reviews.manager');
    Route::delete('/reviews/{review}', [PerformanceController::class, 'destroyReview'])->middleware('can:performance.manage')->name('reviews.destroy');
});
