"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const express_1 = require("express");
const review_controller_1 = require("../controllers/review.controller");
const auth_middleware_1 = require("../middleware/auth.middleware");
const rbac_middleware_1 = require("../middleware/rbac.middleware");
const validate_middleware_1 = require("../middleware/validate.middleware");
const review_validator_1 = require("../validators/review.validator");
const router = (0, express_1.Router)();
// Public / Customer Endpoints
router.get('/book/:bookId', review_controller_1.getBookReviews);
router.post('/', auth_middleware_1.authenticateJWT, (0, validate_middleware_1.validateRequest)(review_validator_1.createReviewSchema), review_controller_1.createReview);
router.post('/:id/helpful', review_controller_1.voteHelpfulReview);
// Admin Moderation & Response Endpoints
router.post('/:id/reply', auth_middleware_1.authenticateJWT, (0, rbac_middleware_1.authorizeRoles)('ADMIN'), (0, validate_middleware_1.validateRequest)(review_validator_1.adminReplySchema), review_controller_1.adminReplyToReview);
router.put('/:id/moderate', auth_middleware_1.authenticateJWT, (0, rbac_middleware_1.authorizeRoles)('ADMIN'), (0, validate_middleware_1.validateRequest)(review_validator_1.moderateReviewSchema), review_controller_1.moderateReview);
exports.default = router;
//# sourceMappingURL=review.routes.js.map