<?php

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