<?php

use App\Modules\HR\EmploymentStatuses\Controllers\EmploymentStatusPageController;
use Illuminate\Support\Facades\Route;

Route::prefix('hr/employment-statuses')
    ->name('hr.employment-statuses.')
    ->middleware('module:hr')
    ->group(function () {
        Route::get('/', [EmploymentStatusPageController::class, 'index'])
            ->middleware('can:employment_statuses.view')
            ->name('index');

        Route::get('/create', [EmploymentStatusPageController::class, 'create'])
            ->middleware('can:employment_statuses.create')
            ->name('create');

        Route::post('/', [EmploymentStatusPageController::class, 'store'])
            ->middleware('can:employment_statuses.create')
            ->name('store');

        Route::get('/{employment_status}/edit', [EmploymentStatusPageController::class, 'edit'])
            ->middleware('can:employment_statuses.update,employment_status')
            ->name('edit');

        Route::put('/{employment_status}', [EmploymentStatusPageController::class, 'update'])
            ->middleware('can:employment_statuses.update,employment_status')
            ->name('update');

        Route::post('/{employment_status}/deactivate', [EmploymentStatusPageController::class, 'deactivate'])
            ->middleware('can:employment_statuses.deactivate,employment_status')
            ->name('deactivate');
    });
