<?php

namespace Modules\Settings\Config;

use Config;
// Create a new instance of our RouteCollection class.
$routes = Config\Services::routes();

// Load the system's routing file first, so that the app and ENVIRONMENT
// can override as needed.
if (is_file(SYSTEMPATH . 'Config/Routes.php')) {
    require SYSTEMPATH . 'Config/Routes.php';
}


//setting up Inventory routes.
$routes->group('administrator/settings', ['filter' => ['isLoggedIn',  'checkPermission'], 'namespace' => 'Modules\Settings\Controllers'],   static function($routes){

    $routes->get('all', 'LTcmsSettings::index');
    $routes->get('site', 'CompanySettings::index');
    

    $routes->match(['get', 'post'], 'company', 'CompanySettings::setCompany');
    $routes->match(['get', 'post'], 'policies', 'CompanySettings::managePolicies');
    $routes->get('delete-policy/(:num)', 'CompanySettings::deletePolicy/$1');

    $routes->match(['get', 'post'], 'permissions', 'SystemPermissions::managePermission');
    $routes->get('delete-permission/(:num)', 'SystemPermissions::deletePermission/$1');
    $routes->get('show-group-permissions/(:num)', 'SystemPermissions::getGroupPermissions/$1');
    $routes->post('update-group-permission', 'SystemPermissions::updateGroupPermission');

    $routes->post('module-sections/create', 'LTcmsSettings::createModuleSection');
    $routes->get('module-sections/edit/(:num)', 'LTcmsSettings::editModuleSection/$1');
    $routes->post('module-sections/update', 'LTcmsSettings::updateModuleSection');
    $routes->get('module-sections/delete/(:num)', 'LTcmsSettings::deleteModuleSection/$1');


});
