const express = require("express");
const ctrl    = require("../controllers/gatewayController");

const router = express.Router();

// Public
router.get("/status/active",   ctrl.getActiveGateways);

// Admin
router.get("/",                ctrl.getAllGateways);
router.get("/audit",           ctrl.getAuditLog);
router.post("/reset",          ctrl.resetGateways);
router.get("/:id",             ctrl.getGateway);
router.post("/",               ctrl.createGateway);
router.patch("/:id",           ctrl.updateGateway);
router.post("/:id/toggle",     ctrl.toggleGateway);
router.delete("/:id",          ctrl.deleteGateway);

module.exports = router;
