This commit is contained in:
Carl-Gerhard Lindesvärd
2025-12-17 22:59:11 +01:00
parent bc84404235
commit ccff90829b
33 changed files with 1882 additions and 1083 deletions

View File

@@ -35,22 +35,6 @@ export const insightRouter = createTRPCRouter({
impactScore: 'desc',
},
take: limit * 3, // Fetch 3x to account for deduplication
select: {
id: true,
title: true,
summary: true,
payload: true,
currentValue: true,
compareValue: true,
changePct: true,
direction: true,
moduleKey: true,
dimensionKey: true,
windowKind: true,
severityBand: true,
firstDetectedAt: true,
impactScore: true,
},
});
// WindowKind priority: yesterday (1) > rolling_7d (2) > rolling_30d (3)
@@ -111,22 +95,6 @@ export const insightRouter = createTRPCRouter({
impactScore: 'desc',
},
take: limit,
select: {
id: true,
title: true,
summary: true,
payload: true,
currentValue: true,
compareValue: true,
changePct: true,
direction: true,
moduleKey: true,
dimensionKey: true,
windowKind: true,
severityBand: true,
firstDetectedAt: true,
impactScore: true,
},
});
return insights;