"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const express_1 = require("express");
const ai_controller_1 = require("../controllers/ai.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 ai_validator_1 = require("../validators/ai.validator");
const router = (0, express_1.Router)();
// ==========================================
// 1. PUBLIC RECOMMENDATIONS & SEARCH
// ==========================================
router.get('/recommendations/similar/:bookId', ai_controller_1.getSimilarBooks);
router.get('/recommendations/trending', ai_controller_1.getTrendingRecommendations);
router.get('/recommendations/personalized', auth_middleware_1.authenticateJWT, ai_controller_1.getPersonalizedRecommendations);
router.get('/search', ai_controller_1.smartSearch);
router.post('/search', (0, validate_middleware_1.validateRequest)(ai_validator_1.smartSearchSchema), ai_controller_1.smartSearch);
router.get('/search/suggestions', ai_controller_1.getSearchSuggestions);
// ==========================================
// 2. CUSTOMER CHAT ASSISTANT (RAG)
// ==========================================
router.post('/chat', (0, validate_middleware_1.validateRequest)(ai_validator_1.chatSchema), ai_controller_1.chatWithAssistant);
// ==========================================
// 3. IMAGE OPTIMIZATION
// ==========================================
router.post('/image/optimize', ai_controller_1.optimizeImage);
// ==========================================
// 4. ADMIN GENERATIVE AI SUITE
// ==========================================
router.post('/generate-description', auth_middleware_1.authenticateJWT, (0, rbac_middleware_1.authorizeRoles)('ADMIN'), (0, validate_middleware_1.validateRequest)(ai_validator_1.generateDescriptionSchema), ai_controller_1.generateDescription);
router.post('/generate-seo', auth_middleware_1.authenticateJWT, (0, rbac_middleware_1.authorizeRoles)('ADMIN'), (0, validate_middleware_1.validateRequest)(ai_validator_1.generateSeoSchema), ai_controller_1.generateSeo);
router.post('/generate-keywords', auth_middleware_1.authenticateJWT, (0, rbac_middleware_1.authorizeRoles)('ADMIN'), (0, validate_middleware_1.validateRequest)(ai_validator_1.generateKeywordsSchema), ai_controller_1.generateKeywords);
router.post('/generate-faqs', auth_middleware_1.authenticateJWT, (0, rbac_middleware_1.authorizeRoles)('ADMIN'), (0, validate_middleware_1.validateRequest)(ai_validator_1.generateFaqsSchema), ai_controller_1.generateFaqs);
router.post('/generate-tags', auth_middleware_1.authenticateJWT, (0, rbac_middleware_1.authorizeRoles)('ADMIN'), (0, validate_middleware_1.validateRequest)(ai_validator_1.generateAutoTagsSchema), ai_controller_1.generateAutoTags);
// ==========================================
// 5. ADMIN AI BUSINESS ANALYTICS & FORECAST
// ==========================================
router.get('/analytics/forecast', auth_middleware_1.authenticateJWT, (0, rbac_middleware_1.authorizeRoles)('ADMIN'), ai_controller_1.getBusinessAnalytics);
exports.default = router;
//# sourceMappingURL=ai.routes.js.map