Infrastructure low complexity backend
0
Dependencies
0
Dependents
0
Entities
0
Integrations

Description

Infrastructure utility that maintains the authoritative whitelist of permitted dimensions and metrics for the custom report builder. Provides a deterministic validation function used by the Custom Report Service to reject any descriptor fields not on the whitelist, preventing SQL injection and unauthorized data access.

Feature: Custom Reports

query-descriptor-validator

Responsibilities

  • Maintain whitelist of permitted dimension identifiers (activity_type, date_range, peer_mentor, contact_category, org_unit)
  • Maintain whitelist of permitted metric identifiers (count, hours, unique_contacts, completion_rate)
  • Expose a validate function that returns structured errors for any unknown fields

Interfaces

PERMITTED_DIMENSIONS: string[]
PERMITTED_METRICS: string[]
validate(descriptor: QueryDescriptor): ValidationResult