Description
Add a controller route POST /analytics/events/track exposing a generic client-side event ingestion endpoint (e.g. frontend UI interactions). Validate query params with a DTO (class-validator), guard the route with AnalyticsAdminGuard where the data is sensitive, and delegate the computation to track-event.provider.ts.
Why this matters
This is the API surface the analytics dashboard (frontend) and any external reporting tools will consume for 'a generic client-side event ingestion endpoint (e.g. frontend UI interactions)'.
Files to touch
backend/src/analytics/analytics.controller.ts
backend/src/analytics/providers/track-event.provider.ts
backend/src/analytics/dtos/analytics-query.dto.ts
Acceptance Criteria
Notes
This issue is part of the new analytics module effort (tracking, aggregation,
and reporting on player/game activity). Please keep new code inside
backend/src/analytics/ following the same module/controller/service/provider
layout used by existing modules (e.g. progress, streak, quests).
Description
Add a controller route
POST /analytics/events/trackexposing a generic client-side event ingestion endpoint (e.g. frontend UI interactions). Validate query params with a DTO (class-validator), guard the route withAnalyticsAdminGuardwhere the data is sensitive, and delegate the computation totrack-event.provider.ts.Why this matters
This is the API surface the analytics dashboard (frontend) and any external reporting tools will consume for 'a generic client-side event ingestion endpoint (e.g. frontend UI interactions)'.
Files to touch
backend/src/analytics/analytics.controller.tsbackend/src/analytics/providers/track-event.provider.tsbackend/src/analytics/dtos/analytics-query.dto.tsAcceptance Criteria
POST /analytics/events/trackreturns a 200 with the documented response shapebackend/test/analytics.e2e-spec.tsNotes
This issue is part of the new
analyticsmodule effort (tracking, aggregation,and reporting on player/game activity). Please keep new code inside
backend/src/analytics/following the same module/controller/service/providerlayout used by existing modules (e.g.
progress,streak,quests).