<?php

use CodeIgniter\Router\RouteCollection;

/**
 * @var RouteCollection $routes
 */

$routes->setAutoRoute(true);

$routes->get('/', 'Home::index');

$routes->get('admin', function () {
    return redirect()->to('/dashboard');
});

$routes->get('admin/inventory', function () {
    return redirect()->to('/admin/inventory/reference/invreflist');
});

$routes->get('reports', function () {
    return redirect()->to('/reports/landing');
});

$routes->get('admin/phone/', function () {
    return redirect()->to('/admin/phone/ipphone/siplist');
});

$routes->get('environment', 'Settings\EnvController::index');
$routes->post('env/change', 'Settings\EnvController::change');


$routes->get('api/office', 'Api\Office::index');
$routes->get('api/phone', 'Api\Phone::index');

    
// $routes->get('admin/repair/product/listall/(:num)', 'admin\repair\product::listall/$1');

// $routes->post('/home/repairstatus/(:any)', 'home::repairstatus/$1');

// $routes->get('reports/inventory/with_product/(:any)/(:any)/(:any)', 'Reports/Inventory::withProduct/$1/$2/$3');

// $routes->get('admin/delivery/reference/delvreflist/(:num)', 'Admin\Delivery\Reference::delvreflist/$1');
// $routes->get('admin/delivery/reference/delvreflist', 'Admin\Delivery\Reference::delvreflist');

// $routes->get('/products', 'ProductController::index');
// $routes->get('/products/create', 'ProductController::create');
// $routes->post('/products/store', 'ProductController::store');
// $routes->get('/products/edit/(:num)', 'ProductController::edit/$1');
// $routes->post('/products/update/(:num)', 'ProductController::update/$1');
// $routes->get('/products/delete/(:num)', 'ProductController::delete/$1');

// $routes->get('/user', 'UsersController::index');
// $routes->get('/admin', 'AdminController::dashboard');

// $routes->get('home/repairstatus/(:num)', 'Home::repairstatus/$1');
// $routes->get('home/repairstatus', 'Home::repairstatus');

// $routes->get('/migrate', 'Home::migrate'); // Run all migrations
// // $routes->get('/migrate/(:num)', 'Home::migrate/$1'); // Run migrations to a specific version
// $routes->get('/rollback', 'Home::rollback'); // Rollback the last migration

// $routes->get('/pdf/generate', 'PdfController::generatePdf');

// $routes->get('usercontroller', 'UserController::index');
// $routes->get('usercontroller/fetchUsers', 'UserController::fetchUsers');
// $routes->post('usercontroller/createUser', 'UserController::createUser');
// $routes->post('usercontroller/updateUser/(:num)', 'UserController::updateUser/$1');
// $routes->post('usercontroller/deleteUser/(:num)', 'UserController::deleteUser/$1');
// $routes->get('/admincontroller', 'AdminController::dashboard');

// $routes->get('email', 'EmailController::index');
// $routes->post('email/send', 'EmailController::sendMail');
// $routes->get('email/settings', 'EmailController::settingsForm');
// $routes->post('email/saveSettings', 'EmailController::saveSettings');

