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:
@@ -5,6 +5,8 @@ import { scriptsRouter } from './scripts-router';
|
||||
import { waitlistRouter } from './waitlist-router';
|
||||
import { betaRouter } from './beta-router';
|
||||
import { mailRouter } from './mail-router';
|
||||
import { teamRouter } from './team-router';
|
||||
import { analyticsRouter } from './analytics-router';
|
||||
import type { TRPCContext } from './types';
|
||||
import type { TRPCError } from '@trpc/server';
|
||||
import { t } from './router';
|
||||
@@ -17,6 +19,8 @@ export const appRouter = t.router({
|
||||
waitlist: waitlistRouter,
|
||||
beta: betaRouter,
|
||||
mail: mailRouter,
|
||||
team: teamRouter,
|
||||
analytics: analyticsRouter,
|
||||
} as const);
|
||||
|
||||
export type AppRouter = typeof appRouter;
|
||||
|
||||
Reference in New Issue
Block a user