<?php

/**
 * Employees module routes.
 * @var \CodeIgniter\Router\RouteCollection $routes
 */
$routes->group('employees', ['filter' => 'auth'], static function ($routes) {
    $routes->get('/', '\Modules\Employees\Controllers\EmployeeController::index', ['filter' => 'permission:employees.view']);
    $routes->get('create', '\Modules\Employees\Controllers\EmployeeController::createForm', ['filter' => 'permission:employees.create']);
    $routes->post('/', '\Modules\Employees\Controllers\EmployeeController::store', ['filter' => 'permission:employees.create']);
    $routes->get('(:num)/edit', '\Modules\Employees\Controllers\EmployeeController::editForm/$1', ['filter' => 'permission:employees.edit']);
    $routes->post('(:num)', '\Modules\Employees\Controllers\EmployeeController::update/$1', ['filter' => 'permission:employees.edit']);
    $routes->get('(:num)', '\Modules\Employees\Controllers\EmployeeController::show/$1', ['filter' => 'permission:employees.view']);
    $routes->post('(:num)/photo', '\Modules\Employees\Controllers\EmployeeController::uploadPhoto/$1', ['filter' => 'permission:employees.edit']);
    $routes->post('(:num)/activate', '\Modules\Employees\Controllers\EmployeeController::activate/$1', ['filter' => 'permission:employees.edit']);
    $routes->post('(:num)/deactivate', '\Modules\Employees\Controllers\EmployeeController::deactivate/$1', ['filter' => 'permission:employees.edit']);
    $routes->post('(:num)/delete', '\Modules\Employees\Controllers\EmployeeController::destroy/$1', ['filter' => 'permission:employees.delete']);
    $routes->post('(:num)/restore', '\Modules\Employees\Controllers\EmployeeController::restore/$1', ['filter' => 'permission:employees.delete']);
});
