// apps/api/src/routes/search.routes.js

const express = require('express');
const router = express.Router();
const searchController = require('../controllers/search.controller');
const authMiddleware = require('../middleware/auth.middleware');
const checkCredits = require('../middleware/checkCredits');

router.post('/', authMiddleware, checkCredits, searchController.search);
router.get('/history', authMiddleware, searchController.getSearchHistory);
router.delete('/history/:id', authMiddleware, searchController.deleteSearchHistory);
router.get('/today-count', authMiddleware, searchController.getTodaySearchCount);
router.get('/remaining-credits', authMiddleware, searchController.getRemainingCredits);

module.exports = router;