import { Router } from "express";
import {
  createSupplier,
  deleteSupplier,
  getSuppliers,
  updateSupplier
} from "../controllers/suppliersController.js";
import { requirePermission } from "../middleware/auth.js";

const router = Router();

router.get("/", getSuppliers);
router.post("/", requirePermission("suppliers", "create"), createSupplier);
router.put("/:id", requirePermission("suppliers", "edit"), updateSupplier);
router.delete("/:id", requirePermission("suppliers", "delete"), deleteSupplier);

export default router;
