"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const express_1 = require("express");
const productController_js_1 = require("../controllers/productController.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 productValidators_js_1 = require("../validators/productValidators.js");
const router = (0, express_1.Router)();
router.use(authMiddleware_js_1.requireStaff);
router.get("/", (0, validateRequest_js_1.validateQuery)(productValidators_js_1.productListQuerySchema), (0, asyncHandler_js_1.asyncHandler)(productController_js_1.listAdminProducts));
router.post("/", (0, validateRequest_js_1.validateBody)(productValidators_js_1.createProductSchema), (0, asyncHandler_js_1.asyncHandler)(productController_js_1.createAdminProduct));
router.get("/:id", (0, validateRequest_js_1.validateParams)(productValidators_js_1.productIdParamSchema), (0, asyncHandler_js_1.asyncHandler)(productController_js_1.getAdminProductById));
router.patch("/:id", (0, validateRequest_js_1.validateParams)(productValidators_js_1.productIdParamSchema), (0, validateRequest_js_1.validateBody)(productValidators_js_1.updateProductSchema), (0, asyncHandler_js_1.asyncHandler)(productController_js_1.updateAdminProduct));
router.delete("/:id", (0, validateRequest_js_1.validateParams)(productValidators_js_1.productIdParamSchema), (0, asyncHandler_js_1.asyncHandler)(productController_js_1.archiveAdminProduct));
exports.default = router;
//# sourceMappingURL=adminProductRoutes.js.map