Report Configuration

Define report queries, configure per-tenant overrides, set access permissions, and tune execution settings for the Eclipse reporting service.

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

The reporting service decides whether a caller can run a given report by working through a fixed sequence of checks. The first check that matches wins — nothing later in the sequence is consulted once access has been granted.

OrderCheckResult when it matches
1Caller holds GLOBAL_ADMINAccess granted, for any report
2Per-report overrideReport.<reportId>.<accessType>.Allowed lists a role/position the caller holds (checked against the tenant, then the caller's organisation)Access granted
3Report/Dashboard prefix default — report ID starts with Report or Dashboard, and caller holds one of the default rolesAccess granted
4Per-report override contains the literal value CUSTOMERAccess granted (self-service)
5None of the above matchedAccess denied

Two of these checks are things you configure per report — the per-report override and, indirectly, how you name the report ID. The rest are fixed platform behaviour. The next two sections cover each in turn, including a gotcha where they interact.

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. Anyone holding one of those roles can execute the report — but see Report/Dashboard prefix default below: for a report ID starting with Report or Dashboard, this list is not the full story.

Report/Dashboard prefix default

Any report whose report ID starts with Report or Dashboard — the match is case-sensitive, so a report ID starting with lower-case report does not qualify — is also accessible to a fixed set of default roles, on top of whatever the per-report override says:

ScopeRoles
GlobalGLOBAL_ADMIN, GLOBAL_FINANCE_L_1, GLOBAL_FINANCE_L_2, GLOBAL_FINANCE_L_3, GLOBAL_TECH_SUPPORT, GLOBAL_SUPPORT_L_1, GLOBAL_SUPPORT_L_2, GLOBAL_SUPPORT_L_3
InstitutionINSTITUTION_ADMIN, INSTITUTION_FINANCE_L_1, INSTITUTION_FINANCE_L_2, INSTITUTION_FINANCE_L_3, INSTITUTION_TECH_SUPPORT, INSTITUTION_SUPPORT_L_1, INSTITUTION_SUPPORT_L_2, INSTITUTION_SUPPORT_L_3, INSTITUTION_INTEGRATOR
LevelLEVEL_01, LEVEL_02, LEVEL_03, LEVEL_04, LEVEL_05
SystemTENANT_SYSTEM
⚠️

A per-report override does not lock these roles out

The per-report override is checked first (step 2 in the table above), but if the caller's role isn't on that list, the service falls through to this prefix default (step 3) — and a caller holding any role from the table above is still granted access, regardless of what the override says. Narrowing Report.<reportId>.READ.Allowed does not exclude these roles for a report ID starting with Report or Dashboard.

To fully restrict a report to a custom role list, avoid naming the report ID with a Report or Dashboard prefix. If the report ID must use one of those prefixes, treat the table above as part of that report's effective audience, not just the roles named in the override.


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.

Did this page help you?