import express from "express";
import { PaymentSlip } from "$controllers/index.js";
import {
  checkPermission,
  ensureTadbirVerified,
  requireSejamVerified,
} from "$middlewares/index.js";

const router = express.Router();

router.get("/", checkPermission("paymentSlips:view"), PaymentSlip.ALL);
router.get("/:id", checkPermission("paymentSlips:view"), PaymentSlip.SINGLE);
router.post(
  "/",
  requireSejamVerified,
  ensureTadbirVerified,
  PaymentSlip.CREATE,
);
router.put(
  "/:id",
  checkPermission("paymentSlips:update"),
  PaymentSlip.UPDATE,
);
router.delete(
  "/:id",
  checkPermission("paymentSlips:delete"),
  PaymentSlip.DELETE,
);

export default router;
