Fix AI Learning Status to use real data

- Remove userId filtering to match ai-analytics behavior
- Now shows correct 911 learning records (was 602)
- Shows correct 69 trades (was 67)
- Displays real 64% win rate instead of subset data
- AI Learning Status panel now shows actual trading performance
This commit is contained in:
mindesbunister
2025-07-26 11:35:51 +02:00
parent 5bf25ca3ee
commit 1154cb80cd

View File

@@ -19,18 +19,13 @@ export interface AILearningStatus {
export async function getAILearningStatus(userId: string): Promise<AILearningStatus> { export async function getAILearningStatus(userId: string): Promise<AILearningStatus> {
try { try {
// Get learning data // Get ALL learning data (not filtered by userId to match ai-analytics behavior)
const learningData = await prisma.ai_learning_data.findMany({ const learningData = await prisma.ai_learning_data.findMany({
where: { userId },
orderBy: { createdAt: 'desc' } orderBy: { createdAt: 'desc' }
}) })
// Get trade data - use real database data instead of demo numbers // Get ALL trade data (not filtered by userId to match ai-analytics behavior)
const trades = await prisma.trades.findMany({ const trades = await prisma.trades.findMany({
where: {
userId,
// isAutomated: true // This field might not exist in current schema
},
orderBy: { createdAt: 'desc' } orderBy: { createdAt: 'desc' }
}) })