Report Configuration

Reports are defined as platform properties consumed by the reporting service at runtime. Each report has a unique report ID and a property value that specifies the query type, data source, and query to execute. You can override any report definition for a specific tenant without affecting the global default.

Prerequisites

  • Access to the Eclipse platform property store (via Admin Portal or API)
  • A valid database connection name configured in the reporting service

Report Definition Format

Reports are stored as platform properties under the reporting.config namespace. The property value is a comma-separated string in the format:

<type>,<connectionName>,<query>

Report types

TypeDescription
sqlExecutes a SQL SELECT against a named database connection
pngwExecutes a SQL query against the Postilion gateway database
pbSends an ISO 8583 message to the Postilion NID switch and parses the response

SQL and PNGW report format

sql,<connectionName>,<sql query>

Example:

sql,eclipse-db,SELECT wallet_id, balance, currency FROM wallet WHERE tenant_id = <tenantId> AND created >= ?D1?

Postilion (PB) report format

pb,<serviceName>,<commandId>

Property Keys

Report definition

PropertyDescription
reporting.config.<reportId>Global report definition. Value is the comma-separated type/connection/query string.
reporting.config.<tenantId>.<reportId>Tenant-specific override. Takes precedence over the global definition for that tenant.

Execution tuning

PropertyDefaultDescription
reporting.config.queryTimeoutSeconds15Maximum seconds a SQL query may run before the reporting service cancels it.
reporting.config.db.connection.maxAttempts3Number of times the service retries a failed database connection before returning an error.
reporting.config.db.connection.baseDelayInMillis1000Base delay in milliseconds between connection retry attempts.
reporting.deny.loose.queriesfalseWhen true, reports that do not include <tenantId> or <organisationId> template variables are blocked for non-system users. Set this to true in production to prevent cross-tenant data exposure.

Query Parameters and Template Variables

Report SQL queries support two types of runtime substitution.

Template variables (server-resolved)

These are replaced by the reporting service before the query executes.

VariableReplaced with
<tenantId>The tenant ID from the request parameter, or the authenticated user's tenant
<userId>The authenticated user's ID
<organisationId>The organisation ID from the request parameter, or the user's position's organisation

Typed placeholders (caller-supplied)

Callers pass values via query parameters on the report API call. The service binds them to the SQL as prepared statement parameters.

PlaceholderQuery parameterType
?S1??S20?s1s20String
?N1??N8?n1n8Numeric (double)
?D1??D8?d1d8Date (ISO 8601 string, parsed to timestamp)

Example query using both:

SELECT * FROM payment
WHERE tenant_id = <tenantId>
  AND status = ?S1?
  AND created >= ?D1?
  AND created < ?D2?
  AND amount >= ?N1?

Access Control

Default role-based access

The reporting service grants access to reports based on the authenticated user's role. The following roles have access to standard reports and dashboards by default:

GLOBAL_ADMIN, GLOBAL_FINANCE_L_1/L_2/L_3, GLOBAL_TECH_SUPPORT, GLOBAL_SUPPORT_L_1/L_2/L_3, INSTITUTION_ADMIN, INSTITUTION_FINANCE_L_1/L_2/L_3, INSTITUTION_TECH_SUPPORT, INSTITUTION_SUPPORT_L_1/L_2/L_3, INSTITUTION_INTEGRATOR, LEVEL_01 through LEVEL_05, TENANT_SYSTEM

Per-report permission override

To restrict a specific report to a named set of roles or positions, set the following tenant config item:

Report.<reportId>.READ.Allowed = GLOBAL_ADMIN,INSTITUTION_ADMIN

The value is a comma-delimited list of role or position names. Only users holding one of those roles can execute the report.


Post-Logic Handlers

After a report executes, the service invokes a configurable post-logic handler. The default handler is a no-op. You can assign a custom implementation per report.

PropertyDescription
report.<reportId>.config.reportPostLogicHandlerClassFully qualified class name of the IReportPostLogicHandler implementation to invoke after this report runs. Defaults to com.ukheshe.services.reporting.post.handler.DefaultReportPostLogicHandler.