const express = require("express");
const router = express.Router();
const authMiddleware = require("../middleware/authMiddleware");
const superAdminMiddleware = require("../middleware/superAdminMiddleware");
const c = require("../controllers/superAdmin");

router.use(authMiddleware);
router.use(superAdminMiddleware);

router.get("/dashboard", c.dashboard);
router.get("/companies", c.listCompanies);
router.get("/companies/:id", c.getCompany);
router.get("/requests", c.listRequests);
router.post("/requests/:subscriptionId/price", c.setRequestPrices);
router.post("/companies/:id/extend", c.extendSubscription);
router.post("/companies/:id/suspend", c.suspendCompany);
router.get("/analytics", c.analytics);

module.exports = router;
