<?php

use CodeIgniter\Router\RouteCollection;

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

// API Routes - 그룹화 없이 직접 경로 지정
// Authentication
$routes->get('api/ping', 'App\Controllers\Api\PingController::index');
$routes->post('api/auth/login', 'App\Controllers\Api\AuthController::login');
$routes->post('api/auth/logout', 'App\Controllers\Api\AuthController::logout');
$routes->get('api/auth/validate', 'App\Controllers\Api\AuthController::validate');

// Site Info
$routes->get('api/basic/site-info', 'App\Controllers\Api\BasicController::getSiteInfo');
$routes->put('api/basic/site-info', 'App\Controllers\Api\BasicController::updateSiteInfo');

// Popup Management
$routes->get('api/basic/popup', 'App\Controllers\Api\PopupController::index');
$routes->get('api/basic/popup/(:num)', 'App\Controllers\Api\PopupController::show/$1');
$routes->post('api/basic/popup', 'App\Controllers\Api\PopupController::create');
$routes->put('api/basic/popup/(:num)', 'App\Controllers\Api\PopupController::update/$1');
$routes->delete('api/basic/popup/(:num)', 'App\Controllers\Api\PopupController::delete/$1');

// Branch List
$routes->get('api/branch/list', 'App\Controllers\Api\BranchController::index');

// Branch Manager
$routes->get('api/branch/manager', 'App\Controllers\Api\BranchManagerController::index');
$routes->get('api/branch/manager/(:num)', 'App\Controllers\Api\BranchManagerController::show/$1');
$routes->post('api/branch/manager', 'App\Controllers\Api\BranchManagerController::create');
$routes->put('api/branch/manager/(:num)', 'App\Controllers\Api\BranchManagerController::update/$1');
$routes->delete('api/branch/manager/(:num)', 'App\Controllers\Api\BranchManagerController::delete/$1');

// Sales Staff
$routes->get('api/staff/sales', 'App\Controllers\Api\SalesStaffController::index');
$routes->get('api/staff/sales/(:num)', 'App\Controllers\Api\SalesStaffController::show/$1');
$routes->post('api/staff/sales', 'App\Controllers\Api\SalesStaffController::create');
$routes->put('api/staff/sales/(:num)', 'App\Controllers\Api\SalesStaffController::update/$1');
$routes->delete('api/staff/sales/(:num)', 'App\Controllers\Api\SalesStaffController::delete/$1');
$routes->get('api/staff/sales/excel', 'App\Controllers\Api\SalesStaffController::exportExcel');
$routes->get('api/staff/sales/(:num)/excel', 'App\Controllers\Api\SalesStaffController::exportSingleExcel/$1');
$routes->get('api/staff/sales/(:num)/print', 'App\Controllers\Api\SalesStaffController::printSingle/$1');

// Advisor Staff
$routes->get('api/staff/advisor', 'App\Controllers\Api\AdvisorController::index');
$routes->get('api/staff/advisor/(:num)', 'App\Controllers\Api\AdvisorController::show/$1');
$routes->post('api/staff/advisor', 'App\Controllers\Api\AdvisorController::create');
$routes->put('api/staff/advisor/(:num)', 'App\Controllers\Api\AdvisorController::update/$1');
$routes->delete('api/staff/advisor/(:num)', 'App\Controllers\Api\AdvisorController::delete/$1');

// Brochure Requests
$routes->get('api/service/brochure', 'App\Controllers\Api\BrochureController::index');
$routes->put('api/service/brochure/(:num)/status', 'App\Controllers\Api\BrochureController::updateStatus/$1');
$routes->delete('api/service/brochure/(:num)', 'App\Controllers\Api\BrochureController::delete/$1');
$routes->get('api/service/brochure/excel', 'App\Controllers\Api\BrochureController::exportExcel');

// Event Board
$routes->get('api/board/event', 'App\Controllers\Api\EventController::index');
$routes->get('api/board/event/(:num)', 'App\Controllers\Api\EventController::show/$1');
$routes->post('api/board/event', 'App\Controllers\Api\EventController::create');
$routes->put('api/board/event/(:num)', 'App\Controllers\Api\EventController::update/$1');
$routes->delete('api/board/event/(:num)', 'App\Controllers\Api\EventController::delete/$1');

// News Board
$routes->get('api/board/news', 'App\Controllers\Api\NewsController::index');
$routes->get('api/board/news/(:num)', 'App\Controllers\Api\NewsController::show/$1');
$routes->post('api/board/news', 'App\Controllers\Api\NewsController::create');
$routes->put('api/board/news/(:num)', 'App\Controllers\Api\NewsController::update/$1');
$routes->delete('api/board/news/(:num)', 'App\Controllers\Api\NewsController::delete/$1');

// IR Board
$routes->get('api/board/ir', 'App\Controllers\Api\IrController::index');
$routes->get('api/board/ir/(:num)', 'App\Controllers\Api\IrController::show/$1');
$routes->post('api/board/ir', 'App\Controllers\Api\IrController::create');
$routes->put('api/board/ir/(:num)', 'App\Controllers\Api\IrController::update/$1');
$routes->delete('api/board/ir/(:num)', 'App\Controllers\Api\IrController::delete/$1');

// File Upload
$routes->post('api/upload/file', 'App\Controllers\Api\UploadController::uploadFile');
$routes->post('api/upload/image', 'App\Controllers\Api\UploadController::uploadImage');
