<?php

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

$routes->group('documents', ['filter' => 'auth'], static function ($routes) {
    $routes->get('/', '\Modules\Documents\Controllers\EmployeeDocumentController::index', ['filter' => 'permission:employee_documents.view']);
    $routes->get('expiry', '\Modules\Documents\Controllers\EmployeeDocumentController::expiry', ['filter' => 'permission:employee_documents.view']);
    $routes->get('create', '\Modules\Documents\Controllers\EmployeeDocumentController::createForm', ['filter' => 'permission:employee_documents.create']);
    $routes->post('/', '\Modules\Documents\Controllers\EmployeeDocumentController::store', ['filter' => 'permission:employee_documents.create']);
    $routes->get('(:num)/download', '\Modules\Documents\Controllers\EmployeeDocumentController::download/$1', ['filter' => 'permission:employee_documents.download']);
    $routes->get('(:num)/edit', '\Modules\Documents\Controllers\EmployeeDocumentController::editForm/$1', ['filter' => 'permission:employee_documents.edit']);
    $routes->post('(:num)', '\Modules\Documents\Controllers\EmployeeDocumentController::update/$1', ['filter' => 'permission:employee_documents.edit']);
    $routes->post('(:num)/delete', '\Modules\Documents\Controllers\EmployeeDocumentController::destroy/$1', ['filter' => 'permission:employee_documents.delete']);
    $routes->get('(:num)', '\Modules\Documents\Controllers\EmployeeDocumentController::show/$1', ['filter' => 'permission:employee_documents.view']);
});
