"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const express_1 = require("express");
const orderController_js_1 = require("../controllers/orderController.js");
const uploadController_js_1 = require("../controllers/uploadController.js");
const authMiddleware_js_1 = require("../middleware/authMiddleware.js");
const uploadMiddleware_js_1 = require("../middleware/uploadMiddleware.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.requireAuth);
router.get("/", (0, validateRequest_js_1.validateQuery)(orderValidators_js_1.customerOrderListQuerySchema), (0, asyncHandler_js_1.asyncHandler)(orderController_js_1.listMyOrders));
router.post("/", (0, validateRequest_js_1.validateBody)(orderValidators_js_1.createOrderSchema), (0, asyncHandler_js_1.asyncHandler)(orderController_js_1.createOrder));
router.get("/:id", (0, validateRequest_js_1.validateParams)(orderValidators_js_1.orderIdParamSchema), (0, asyncHandler_js_1.asyncHandler)(orderController_js_1.getMyOrderById));
router.post("/upload-prescription", uploadMiddleware_js_1.prescriptionUpload.array("file", 1), (0, asyncHandler_js_1.asyncHandler)(uploadController_js_1.uploadPrescription));
exports.default = router;
//# sourceMappingURL=orderRoutes.js.map