FRE-622: Wire analytics services to tRPC API layer with comprehensive router
Create analytics-router.ts with ~30 tRPC endpoints for KPI management, alert rules, scheduled reports, cohort analysis, and NPS survey integration. Register router in index.ts under 'analytics' namespace. Fix pre-existing bugs in service files: snake_case to camelCase conversion, missing non-null assertions, and incorrect DB access patterns. Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
@@ -178,7 +178,7 @@ export async function createScheduledReport(
|
||||
lastRunAt: null,
|
||||
nextRunAt: computeNextRun(input.schedule),
|
||||
}).returning();
|
||||
return result[0];
|
||||
return result[0]!;
|
||||
}
|
||||
|
||||
export async function getActiveScheduledReports(
|
||||
|
||||
Reference in New Issue
Block a user