import express from "express";
import { Transaction } from "$controllers/index.js";
import { checkPermission } from "$middlewares/index.js";

const router = express.Router();

router.get("/", checkPermission("transactions:view"), Transaction.ALL);
router.get("/:id", checkPermission("transactions:view"), Transaction.SINGLE);
router.post("/", checkPermission("transactions:create"), Transaction.CREATE);
router.put("/:id", checkPermission("transactions:update"), Transaction.UPDATE);
router.delete(
  "/:id",
  checkPermission("transactions:delete"),
  Transaction.DELETE,
);

export default router;
