diff --git a/backend/routers/institutional.py b/backend/routers/institutional.py index 2ea349a..a8fcd16 100644 --- a/backend/routers/institutional.py +++ b/backend/routers/institutional.py @@ -114,7 +114,19 @@ def list_reports( conditions.append("report_type = ?") params.append(report_type) if category: - conditions.append("category = ?") + # For categories that map to a signal column, also match reports + # where that signal is non-neutral (most reports have category='multi') + _signal_col = { + 'forex': 'signal_forex', + 'energy': 'signal_energy', + 'metals': 'signal_metals', + 'equities': 'signal_indices', + 'indices': 'signal_indices', + }.get(category) + if _signal_col: + conditions.append(f"(category = ? OR {_signal_col} != 'neutral')") + else: + conditions.append("category = ?") params.append(category) if importance: conditions.append("importance >= ?") diff --git a/frontend/src/pages/InstitutionalReports.tsx b/frontend/src/pages/InstitutionalReports.tsx index 5ac3b2f..b8dac77 100644 --- a/frontend/src/pages/InstitutionalReports.tsx +++ b/frontend/src/pages/InstitutionalReports.tsx @@ -1,7 +1,8 @@ import { useState } from 'react' +import { Link } from 'react-router-dom' import { useInstitutionalReports, useInstitutionalStats, useRefreshInstitutionalReports } from '../hooks/useApi' import { useQueryClient } from '@tanstack/react-query' -import { RefreshCw, TrendingUp, TrendingDown, Minus, AlertTriangle, Star, CheckCircle, Clock } from 'lucide-react' +import { RefreshCw, TrendingUp, TrendingDown, Minus, AlertTriangle, Star, CheckCircle, Clock, Users, ExternalLink } from 'lucide-react' import clsx from 'clsx' import { format } from 'date-fns' @@ -285,6 +286,21 @@ export default function InstitutionalReports() { )} + {/* Specialist Desks link */} +
+ + + Ces rapports sont analysés automatiquement (fetch + scoring IA). Pour gérer le calendrier des rapports par desk — ajouter un rapport custom (ex. broyage cacao), planifier les prochaines dates, lier à un desk specialist — + + + + Specialist Desks + +
+ {/* Filters */}
@@ -310,18 +326,31 @@ export default function InstitutionalReports() {
Category:
- {['', 'energy', 'metals', 'equities', 'forex', 'volatility', 'macro', 'sentiment', 'multi'].map(c => ( + {([ + { v: '', label: 'All' }, + { v: 'energy', label: 'Energy' }, + { v: 'metals', label: 'Metals' }, + { v: 'agri', label: 'Agri' }, + { v: 'equities', label: 'Equities' }, + { v: 'forex', label: 'Forex' }, + { v: 'crypto', label: 'Crypto' }, + { v: 'bonds', label: 'Bonds' }, + { v: 'volatility',label: 'Volatility'}, + { v: 'macro', label: 'Macro' }, + { v: 'sentiment', label: 'Sentiment'}, + { v: 'multi', label: 'Multi' }, + ]).map(({ v, label }) => ( ))}