const express = require('express');
const router = express.Router();
const metaController = require('../controllers/metaController');

router.get('/categories', metaController.getAllCategories);
router.post('/categories', metaController.createCategory);
router.put('/categories/:id', metaController.updateCategory);
router.get('/categories/:id', metaController.getCategoryById);
router.delete('/categories/:id', metaController.deleteCategory);

router.get('/brands', metaController.getAllBrands);
router.post('/brands', metaController.createBrand);
router.get('/brands/:id', metaController.getBrandById);
router.put('/brands/:id', metaController.updateBrand);
router.delete('/brands/:id', metaController.deleteBrand);

router.get('/units', metaController.getUnits);
router.post('/units', metaController.createUnit);
router.get('/units/:id', metaController.getUnitById);
router.put('/units/:id', metaController.updateUnit);
router.delete('/units/:id', metaController.deleteUnit);

router.get('/latest-sku', metaController.getLatestSku);

router.post('/sizes', metaController.createSize);
router.get('/sizes', metaController.getSizes);
router.get('/sizes/:id', metaController.getSizeById);
router.put('/sizes/:id', metaController.updateSize);
router.delete('/sizes/:id', metaController.deleteSize);

module.exports = router;
