Service Layer high complexity backend
1
Dependencies
1
Dependents
3
Entities
0
Integrations

Description

Backend service that receives a query descriptor from the client, validates every dimension and metric against a server-side whitelist, enforces tenant isolation, and executes a parameterized PostgreSQL query. Never accepts raw SQL or arbitrary field names. Returns paginated JSON to the frontend.

Feature: Custom Reports

custom-report-service

Responsibilities

  • Validate query descriptor dimensions and metrics against a strict server-side whitelist
  • Enforce tenant isolation on every query regardless of client-supplied filters
  • Execute parameterized PostgreSQL queries and return paginated results
  • Reject any descriptor referencing disallowed fields or cross-tenant data

Interfaces

POST /api/v1/reports/custom
validateDescriptor(descriptor: QueryDescriptor): ValidationResult
executeReport(descriptor: QueryDescriptor, tenantId: string, page: number, pageSize: number): Promise<ReportResult>

Relationships

Dependencies (1)

Components this component depends on

Dependents (1)

Components that depend on this component

Related Data Entities (3)

Data entities managed by this component