"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const express_1 = require("express");
const orderController_js_1 = require("../controllers/orderController.js");
const authMiddleware_js_1 = require("../middleware/authMiddleware.js");
const validateRequest_js_1 = require("../middleware/validateRequest.js");
const asyncHandler_js_1 = require("../utils/asyncHandler.js");
const orderValidators_js_1 = require("../validators/orderValidators.js");
const router = (0, express_1.Router)();
router.use(authMiddleware_js_1.requireStaff);
router.get("/", (0, validateRequest_js_1.validateQuery)(orderValidators_js_1.adminOrderListQuerySchema), (0, asyncHandler_js_1.asyncHandler)(orderController_js_1.listOrdersForAdmin));
router.get("/:id", (0, validateRequest_js_1.validateParams)(orderValidators_js_1.orderIdParamSchema), (0, asyncHandler_js_1.asyncHandler)(orderController_js_1.getOrderForAdmin));
router.patch("/:id", (0, validateRequest_js_1.validateParams)(orderValidators_js_1.orderIdParamSchema), (0, validateRequest_js_1.validateBody)(orderValidators_js_1.updateOrderSchema), (0, asyncHandler_js_1.asyncHandler)(orderController_js_1.updateOrderForAdmin));
exports.default = router;
//# sourceMappingURL=adminOrderRoutes.js.map