<?php

use CodeIgniter\Router\RouteCollection;

/**
 * @var RouteCollection $routes
 */
$routes->get('/', 'Home::index');

$routes->get('hi', 'DashboardController::index');

$routes->get('hr', 'HRController::index');

// Human Resources Routes
$routes->get('hr/dept', 'HRController::companyDepartment');
$routes->post('hr/adddept', 'HRController::addCompanyDepartment');

$routes->get('hr/branch', 'HRController::companyBranch');
$routes->post('hr/addbranch', 'HRController::addCompanyBranch');

$routes->get('hr/jobtitle', 'HRController::jobTitle');
$routes->post('hr/addjobtitle', 'HRController::addJobTitle');

$routes->get('hr/empstatus', 'HRController::employmentStatus');
$routes->post('hr/addempstatus', 'HRController::addEmploymentStatus');

$routes->get('hr/emp', 'HRController::employee');
$routes->post('hr/addemp', 'HRController::addEmployee');


// Payroll Routes
$routes->get('payroll', 'PayrollController::index');

$routes->get('payroll/paygroup', 'PayrollController::payrollGroup');
$routes->post('payroll/addpaygroup', 'PayrollController::addPayrollGroup');

$routes->get('payroll/emppaygrpassign', 'PayrollController::employeePayrollGroupAssignment');
$routes->post('payroll/addemppaygrpassign', 'PayrollController::addEmployeePayrollGroupAssignment');

// Administrator Routes
$routes->get('adminuser', 'AdministratorController::index');
$routes->get('adminuser/newuser', 'AdministratorController::newUserView');
$routes->get('adminuser/getuserbyid/(:num)', 'AdministratorController::getUserById/$1');
$routes->post('adminuser/adduser', 'AdministratorController::saveNewUser');
$routes->post('adminuser/updateuser', 'AdministratorController::updateUser');
$routes->post('adminuser/deleteuser', 'AdministratorController::deleteUser');
$routes->get('adminuser/editusergroup/(:num)', 'AdministratorController::editUserGroupView/$1');
$routes->get('adminuser/edituserpermission/(:num)', 'AdministratorController::editUserPermissionView/$1');
$routes->post('adminuser/saveusergroup', 'AdministratorController::saveEditedUserGroup');

service('auth')->routes($routes);
