Build the backend for the BI app’s Custom Report Generator. Analysts will pick dimensions, metrics, and filters from a fixed data model to create ad‑hoc reports. Provide a REST API (Node.js/Express) that accepts a JSON report definition and returns results. The service should safely translate the request into SQL for MySQL using whitelisted fields/joins and parameterized queries, support joins, grouping/aggregations, date ranges, sorting, and pagination, and enforce a per‑request timeout that cancels long‑running queries. For repeated requests with identical parameters, add Redis caching: compute a stable hash from a canonicalized request, check cache first, and cache fresh results with a TTL. Return clear errors when the request references unknown fields or unsupported combinations.