<?php

use CodeIgniter\Router\RouteCollection;

/**
 * @var RouteCollection $routes
 */
$routes->get('/', 'AuthController::index');
$routes->get('login', 'AuthController::index');
$routes->post('login', 'AuthController::login');
$routes->get('logout', 'AuthController::logout');

$routes->get('admin', 'AdminController::dashboard');
$routes->get('admin/dashboard', 'AdminController::dashboard');
$routes->post('admin/uploads/temp/(:segment)', 'TempUploadController::store/$1');

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

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

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

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

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

$routes->get('admin/barang', 'BarangController::index');
$routes->get('admin/barang/create', 'BarangController::create');
$routes->post('admin/barang/store', 'BarangController::store');
$routes->get('admin/barang/check-kode', 'BarangController::checkKode');
$routes->get('admin/barang/import', 'BarangController::import');
$routes->post('admin/barang/import/store', 'BarangController::storeImport');
$routes->get('admin/barang/import/template', 'BarangController::downloadImportTemplate');
$routes->get('admin/barang/detail/(:num)', 'BarangController::detail/$1');
$routes->get('admin/barang/edit/(:num)', 'BarangController::edit/$1');
$routes->post('admin/barang/update/(:num)', 'BarangController::update/$1');
$routes->post('admin/barang/delete/(:num)', 'BarangController::delete/$1');
$routes->get('admin/barang/qrcode/(:num)', 'BarangController::downloadQrCode/$1');
$routes->get('admin/barang/barcode/(:num)', 'BarangController::downloadBarcode/$1');
$routes->get('admin/barang/print/qrcode', 'BarangController::printMassQrCode');
$routes->get('admin/barang/print/barcode', 'BarangController::printMassBarcode');

$routes->get('admin/pembelian', 'PembelianController::index');
$routes->get('admin/pembelian/create', 'PembelianController::create');
$routes->post('admin/pembelian/store', 'PembelianController::store');
$routes->get('admin/pembelian/pdf/(:num)', 'PembelianController::exportPdf/$1');
$routes->get('admin/pembelian/detail/(:num)', 'PembelianController::detail/$1');
$routes->get('admin/pembelian/cicilan/(:num)', 'PembelianController::cicilan/$1');
$routes->post('admin/pembelian/cicilan/store/(:num)', 'PembelianController::storeCicilan/$1');
$routes->post('admin/pembelian/cicilan/delete/(:num)/(:num)', 'PembelianController::deleteCicilan/$1/$2');
$routes->get('admin/pembelian/edit/(:num)', 'PembelianController::edit/$1');
$routes->post('admin/pembelian/update/(:num)', 'PembelianController::update/$1');
$routes->post('admin/pembelian/delete/(:num)', 'PembelianController::delete/$1');
$routes->get('admin/pembelian/generate-number', 'PembelianController::generateNumber');
$routes->get('admin/pembelian/barang/lookup', 'PembelianController::lookupBarang');
$routes->get('admin/pembelian/barang/datatable', 'PembelianController::barangDataTable');

$routes->get('admin/penjualan', 'PenjualanController::index');
$routes->get('admin/penjualan/create', 'PenjualanController::create');
$routes->post('admin/penjualan/store', 'PenjualanController::store');
$routes->get('admin/penjualan/detail/(:num)', 'PenjualanController::detail/$1');
$routes->get('admin/penjualan/nota/(:num)', 'PenjualanController::nota/$1');
$routes->get('admin/penjualan/nota/pdf/(:num)', 'PenjualanController::notaPdf/$1');
$routes->get('admin/penjualan/cicilan/(:num)', 'PenjualanController::cicilan/$1');
$routes->post('admin/penjualan/cicilan/store/(:num)', 'PenjualanController::storeCicilan/$1');
$routes->post('admin/penjualan/cicilan/delete/(:num)/(:num)', 'PenjualanController::deleteCicilan/$1/$2');
$routes->get('admin/penjualan/edit/(:num)', 'PenjualanController::edit/$1');
$routes->post('admin/penjualan/update/(:num)', 'PenjualanController::update/$1');
$routes->post('admin/penjualan/delete/(:num)', 'PenjualanController::delete/$1');
$routes->get('admin/penjualan/generate-number', 'PenjualanController::generateNumber');
$routes->get('admin/penjualan/barang/lookup', 'PenjualanController::lookupBarang');
$routes->get('admin/penjualan/barang/datatable', 'PenjualanController::barangDataTable');

$routes->get('admin/service', 'ServiceController::index');
$routes->get('admin/service/create', 'ServiceController::create');
$routes->post('admin/service/store', 'ServiceController::store');
$routes->get('admin/service/detail/(:num)', 'ServiceController::detail/$1');
$routes->get('admin/service/nota/(:num)', 'ServiceController::nota/$1');
$routes->get('admin/service/nota/pdf/(:num)', 'ServiceController::notaPdf/$1');
$routes->get('admin/service/edit/(:num)', 'ServiceController::edit/$1');
$routes->post('admin/service/update/(:num)', 'ServiceController::update/$1');
$routes->post('admin/service/delete/(:num)', 'ServiceController::delete/$1');
$routes->get('admin/service/cicilan/(:num)', 'ServiceController::cicilan/$1');
$routes->post('admin/service/cicilan/store/(:num)', 'ServiceController::storeCicilan/$1');
$routes->post('admin/service/cicilan/delete/(:num)/(:num)', 'ServiceController::deleteCicilan/$1/$2');
$routes->get('admin/service/generate-number', 'ServiceController::generateNumber');
$routes->get('admin/service/barang/lookup', 'ServiceController::lookupBarang');
$routes->get('admin/service/barang/datatable', 'ServiceController::barangDataTable');

$routes->get('admin/stok-penyesuaian', 'StokPenyesuaianController::index');
$routes->get('admin/stok-penyesuaian/create', 'StokPenyesuaianController::create');
$routes->post('admin/stok-penyesuaian/store', 'StokPenyesuaianController::store');
$routes->get('admin/stok-penyesuaian/detail/(:num)', 'StokPenyesuaianController::detail/$1');
$routes->post('admin/stok-penyesuaian/cancel/(:num)', 'StokPenyesuaianController::cancel/$1');
$routes->get('admin/stok-penyesuaian/generate-number', 'StokPenyesuaianController::generateNumber');

$routes->get('admin/laporan/stok', 'LaporanController::stok');
$routes->get('admin/laporan/stok/pdf', 'LaporanController::stokPdf');
$routes->get('admin/laporan/stok/excel', 'LaporanController::stokExcel');
$routes->get('admin/laporan/pembelian', 'LaporanController::pembelian');
$routes->get('admin/laporan/pembelian/pdf', 'LaporanController::pembelianPdf');
$routes->get('admin/laporan/pembelian/excel', 'LaporanController::pembelianExcel');
$routes->get('admin/laporan/penjualan', 'LaporanController::penjualan');
$routes->get('admin/laporan/penjualan/pdf', 'LaporanController::penjualanPdf');
$routes->get('admin/laporan/penjualan/excel', 'LaporanController::penjualanExcel');
$routes->get('admin/laporan/service', 'LaporanController::service');
$routes->get('admin/laporan/service/pdf', 'LaporanController::servicePdf');
$routes->get('admin/laporan/service/excel', 'LaporanController::serviceExcel');
$routes->get('admin/laporan/penyesuaian-stok', 'LaporanController::penyesuaianStok');
$routes->get('admin/laporan/penyesuaian-stok/pdf', 'LaporanController::penyesuaianStokPdf');
$routes->get('admin/laporan/penyesuaian-stok/excel', 'LaporanController::penyesuaianStokExcel');

$routes->get('admin/users', 'UserController::index');
$routes->get('admin/users/create', 'UserController::create');
$routes->post('admin/users/store', 'UserController::store');
$routes->get('admin/users/edit/(:num)', 'UserController::edit/$1');
$routes->post('admin/users/update/(:num)', 'UserController::update/$1');
$routes->post('admin/users/delete/(:num)', 'UserController::delete/$1');
$routes->get('admin/profile', 'UserController::profile');
$routes->post('admin/profile/update', 'UserController::updateProfile');
$routes->get('admin/change-password', 'UserController::changePassword');
$routes->post('admin/change-password/update', 'UserController::updatePassword');

$routes->get('admin/backup', 'BackupController::index');
$routes->get('admin/backup/download', 'BackupController::download');

$routes->get('admin/setting', 'SettingController::index');
$routes->post('admin/setting/update', 'SettingController::update');
