feat: add POST /api/precedent-analysis for research "Analiz modu"

Takes the user's described situation plus the top search results and
asks the AI model for a short legal assessment. Auth-protected since
it's a paid AI call.
This commit is contained in:
mstfyldz
2026-08-09 10:47:59 +03:00
parent 0e40aaef96
commit d213d68e0f
2 changed files with 67 additions and 1 deletions
+3 -1
View File
@@ -1,9 +1,11 @@
import { Router } from 'express';
import { searchPrecedents, getPrecedentDocument } from '../controllers/precedent.controller';
import { requireAuth } from '../middleware/auth';
import { searchPrecedents, getPrecedentDocument, analyzePrecedents } from '../controllers/precedent.controller';
const router = Router();
router.post('/search-precedents', searchPrecedents);
router.get('/precedent-document/:documentId', getPrecedentDocument);
router.post('/precedent-analysis', requireAuth, analyzePrecedents);
export default router;