<?php

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

$routes->group('assets/assignments', ['filter' => 'auth'], static function ($routes) {
    $routes->get('/', '\Modules\Assets\Controllers\EmployeeAssetController::index', ['filter' => 'permission:employee_assets.view']);
    $routes->post('/', '\Modules\Assets\Controllers\EmployeeAssetController::store', ['filter' => 'permission:employee_assets.create']);
    $routes->get('(:num)/edit', '\Modules\Assets\Controllers\EmployeeAssetController::editForm/$1', ['filter' => 'permission:employee_assets.edit']);
    $routes->post('(:num)', '\Modules\Assets\Controllers\EmployeeAssetController::update/$1', ['filter' => 'permission:employee_assets.edit']);
    $routes->post('(:num)/return', '\Modules\Assets\Controllers\EmployeeAssetController::returnAsset/$1', ['filter' => 'permission:employee_assets.return']);
    $routes->post('(:num)/delete', '\Modules\Assets\Controllers\EmployeeAssetController::destroy/$1', ['filter' => 'permission:employee_assets.delete']);
});
