import { Router } from "express";
import {
  createService,
  deleteService,
  getServiceById,
  getServices,
  updateService
} from "../controllers/servicesController.js";
import { requirePermission } from "../middleware/auth.js";

const router = Router();

router.get("/", getServices);
router.get("/:id", getServiceById);
router.post("/", requirePermission("services", "create"), createService);
router.put("/:id", requirePermission("services", "edit"), updateService);
router.delete("/:id", requirePermission("services", "delete"), deleteService);

export default router;
