<?php

$router->get('/', 'HomeController', 'index');
$router->get('/home', 'HomeController', 'index');

$router->get('/login', 'AuthController', 'loginForm');
$router->post('/login', 'AuthController', 'login');
$router->get('/register', 'AuthController', 'registerForm');
$router->post('/register', 'AuthController', 'register');
$router->get('/logout', 'AuthController', 'logout');

$router->get('/catalog', 'ProductController', 'catalog');
$router->get('/product/{id}', 'ProductController', 'show');

$router->get('/cart', 'CartController', 'index');
$router->post('/cart/add', 'CartController', 'add');
$router->post('/cart/update', 'CartController', 'update');
$router->post('/cart/remove', 'CartController', 'remove');
$router->get('/cart/count', 'CartController', 'count');

$router->get('/checkout', 'OrderController', 'checkout');
$router->post('/order', 'OrderController', 'create');

$router->get('/services', 'PageController', 'services');
$router->get('/delivery', 'PageController', 'delivery');
$router->get('/warranty', 'PageController', 'warranty');

$router->get('/admin', 'AdminController', 'dashboard');

$router->get('/admin/products', 'AdminController', 'products');
$router->get('/admin/products/add', 'AdminController', 'addProduct');
$router->post('/admin/products/add', 'AdminController', 'storeProduct');
$router->get('/admin/products/edit/{id}', 'AdminController', 'editProduct');
$router->post('/admin/products/edit/{id}', 'AdminController', 'updateProduct');
$router->post('/admin/products/delete/{id}', 'AdminController', 'deleteProduct');
$router->post('/admin/products/remove/{id}', 'AdminController', 'removeProduct');

$router->get('/admin/categories', 'AdminController', 'categories');
$router->get('/admin/categories/add', 'AdminController', 'addCategory');
$router->post('/admin/categories/add', 'AdminController', 'storeCategory');
$router->get('/admin/categories/edit/{id}', 'AdminController', 'editCategory');
$router->post('/admin/categories/edit/{id}', 'AdminController', 'updateCategory');
$router->post('/admin/categories/delete/{id}', 'AdminController', 'deleteCategory');

$router->get('/admin/orders', 'AdminController', 'orders');
$router->get('/admin/orders/{id}', 'AdminController', 'orderDetails');
$router->post('/admin/orders/{id}/status', 'AdminController', 'updateOrderStatus');

$router->get('/admin/users', 'AdminController', 'users');

$router->post('/reviews', 'ReviewController', 'create');
$router->post('/reviews/{id}', 'ReviewController', 'update');
$router->post('/reviews/{id}/delete', 'ReviewController', 'delete');
$router->get('/reviews/product/{id}', 'ReviewController', 'getByProduct');
$router->post('/reviews/{id}/toggle-approval', 'ReviewController', 'toggleApproval');
