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

const router = express.Router();

router.get(
  "/lookup/:cardNumber",
  PaymentCard.LOOKUP,
);
router.get("/", checkPermission("paymentCards:view"), PaymentCard.ALL);
router.post("/", checkPermission("paymentCards:create"), PaymentCard.CREATE);
router.get("/:id", checkPermission("paymentCards:view"), PaymentCard.SINGLE);
router.delete("/:id", checkPermission("paymentCards:delete"), PaymentCard.DELETE);

export default router;
