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
| Type | Description |
|---|---|
sql | Executes a SQL SELECT against a named database connection |
pngw | Executes a SQL query against the Postilion gateway database |
pb | Sends 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
| Property | Description |
|---|---|
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
| Property | Default | Description |
|---|---|---|
reporting.config.queryTimeoutSeconds | 15 | Maximum seconds a SQL query may run before the reporting service cancels it. |
reporting.config.db.connection.maxAttempts | 3 | Number of times the service retries a failed database connection before returning an error. |
reporting.config.db.connection.baseDelayInMillis | 1000 | Base delay in milliseconds between connection retry attempts. |
reporting.deny.loose.queries | false | When 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.
| Variable | Replaced 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.
| Placeholder | Query parameter | Type |
|---|---|---|
?S1? – ?S20? | s1 – s20 | String |
?N1? – ?N8? | n1 – n8 | Numeric (double) |
?D1? – ?D8? | d1 – d8 | Date (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.
| Order | Check | Result when it matches |
|---|---|---|
| 1 | Caller holds GLOBAL_ADMIN | Access granted, for any report |
| 2 | Per-report override — Report.<reportId>.<accessType>.Allowed lists a role/position the caller holds (checked against the tenant, then the caller's organisation) | Access granted |
| 3 | Report/Dashboard prefix default — report ID starts with Report or Dashboard, and caller holds one of the default roles | Access granted |
| 4 | Per-report override contains the literal value CUSTOMER | Access granted (self-service) |
| 5 | None of the above matched | Access 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:
| Scope | Roles |
|---|---|
| Global | GLOBAL_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 |
| Institution | INSTITUTION_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 |
| Level | LEVEL_01, LEVEL_02, LEVEL_03, LEVEL_04, LEVEL_05 |
| System | TENANT_SYSTEM |
A per-report override does not lock these roles outThe 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.Alloweddoes not exclude these roles for a report ID starting withReportorDashboard.To fully restrict a report to a custom role list, avoid naming the report ID with a
ReportorDashboardprefix. 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.
| Property | Description |
|---|---|
report.<reportId>.config.reportPostLogicHandlerClass | Fully qualified class name of the IReportPostLogicHandler implementation to invoke after this report runs. Defaults to com.ukheshe.services.reporting.post.handler.DefaultReportPostLogicHandler. |
Updated 17 days ago
