"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const express_1 = require("express");
const gateway_config_controller_1 = require("../controllers/gateway-config.controller");
const auth_middleware_1 = require("../../../middleware/auth.middleware");
const rbac_middleware_1 = require("../../../middleware/rbac.middleware");
const router = (0, express_1.Router)();
// 1. Public list (checkout selector query)
router.get('/payment-gateways', gateway_config_controller_1.getPublicGateways);
// 2. Admin operations (authenticated as Admin only)
router.get('/admin/payment-gateways', auth_middleware_1.authenticateJWT, (0, rbac_middleware_1.authorizeRoles)('ADMIN'), gateway_config_controller_1.getAdminGateways);
router.post('/admin/payment-gateways', auth_middleware_1.authenticateJWT, (0, rbac_middleware_1.authorizeRoles)('ADMIN'), gateway_config_controller_1.createGatewayConfig);
router.put('/admin/payment-gateways/:id', auth_middleware_1.authenticateJWT, (0, rbac_middleware_1.authorizeRoles)('ADMIN'), gateway_config_controller_1.updateGatewayConfig);
router.delete('/admin/payment-gateways/:id', auth_middleware_1.authenticateJWT, (0, rbac_middleware_1.authorizeRoles)('ADMIN'), gateway_config_controller_1.deleteGateway);
router.post('/admin/payment-gateways/:id/toggle', auth_middleware_1.authenticateJWT, (0, rbac_middleware_1.authorizeRoles)('ADMIN'), gateway_config_controller_1.toggleGateway);
router.post('/admin/payment-gateways/:id/test-connection', auth_middleware_1.authenticateJWT, (0, rbac_middleware_1.authorizeRoles)('ADMIN'), gateway_config_controller_1.testGatewayConnection);
exports.default = router;
//# sourceMappingURL=gateway-config.routes.js.map