const express = require("express");
const router = express.Router();
const authMiddleware = require("../middleware/authMiddleware");
const {
  getSubscriptionDetails,
  webhook,
  createCheckoutSession,
  request,
} = require("../controllers/subscriptions");

router.get("/", authMiddleware, getSubscriptionDetails);

router.get("/create-checkout-session", authMiddleware, createCheckoutSession);

router.post("/request", authMiddleware, request);

router.post("/webhook", express.raw({ type: "application/json" }), webhook);

module.exports = router;
