Skip to main content
Version: 0.58.0-rc.42

Financial Reporting System

The reporting system in Lana serves two distinct purposes: real-time financial statements for operational management and file-based regulatory reports for compliance. These two paths use different data sources and generation mechanisms but share the same underlying accounting data.

Two Reporting Paths

Real-Time Financial Statements

The trial balance, balance sheet, and profit and loss statement are generated in real time directly from the Cala double-entry ledger. They are always up-to-date and reflect the current state of all accounts. These are available immediately through the admin panel and GraphQL API without any batch processing.

See Financial Reports for details on each statement.

File-Based Regulatory Reports

Regulatory reports are generated from the Postgres data warehouse in two steps. End-of-day runs the dbt build that refreshes report-ready SQL relations and functions. After that, individual report files are rendered on demand from those Postgres outputs when an operator downloads them.

Regulatory Report Pipeline

The pipeline has three stages:

  1. Source loading: The outbox relay populates Postgres warehouse tables from public events emitted by the application.

  2. Transform: a single dbt build transforms the warehouse data into report-ready output relations and SQL functions. The models are organized in three tiers:

    • Staging: Clean and normalize raw source data.
    • Intermediate: Apply business logic, reconstruct entity state from event streams, and calculate regulatory classifications and risk categories.
    • Output: Final report tables with the exact columns and formats required by each regulatory norm.
  3. File Download: when an operator downloads a report, Lana reads the selected report from the dbt output relation or SQL function, renders the requested file format (CSV, XML, or fixed-width text), uploads it to storage, and returns a presigned URL.

End-of-Day Refresh

Regulatory report data is refreshed only by the end-of-day data-pipeline phase. The reporting page reads the latest completed EOD process whose data-pipeline phase completed successfully and uses that day as the default source date for downloads.

The dbt pipeline and report rendering are separate:

  • End of day: The EOD process refreshes the dbt output relations and functions for the closing day.
  • Download: An operator downloads an individual report after EOD has refreshed data. Lana renders that report directly from Postgres without running dbt. Reports backed by as-of SQL functions default to the latest completed data refresh day, but callers may request an older as-of date through the download mutation.

Manual mid-day report generation is not supported. To refresh the data warehouse, run end-of-day with the data-pipeline phase enabled.

Regulatory Report Categories

NRP-92: Credit Reference Information

17 sub-reports covering loan portfolio details for the SSF (Superintendencia del Sistema Financiero). Includes borrower information, credit references, collateral details (various guarantee types), expense references, cancelled references, corporate shareholders, and board of directors data. Output in XML (with XSD validation) and CSV.

NRP-91: Financial/Accounting Information

8 sub-reports covering account balances and financial positions: account balances, foreign deposits, off-balance-sheet data, foreign securities, guaranteed loans, guaranteed endorsements, subordinated debt, and projected balance. Output in XML and CSV.

NRSF-03: Deposit Insurance

9 sub-reports for the deposit guarantee fund: customer data, deposits, customer documents, account holders, branches, products, officers and employees, guaranteed deposit summary, and adjustments. Output in CSV and fixed-width text (for SSF submission).

UIF-07: Financial Intelligence Unit

Daily electronic transactions log for anti-money laundering compliance. Output in CSV.

Internal/Operational Reports

Non-regulatory reports for internal analysis: net risk calculation, loan account statements, payment history, active loan listing, and loan portfolio reports. Output in CSV.

Downloading Report Files

After a successful end-of-day data refresh:

  1. Navigate to the reporting section in the admin panel.
  2. Select the desired report from Available Reports.
  3. Click the desired output format.
  4. The system renders the file from Postgres using the selected as-of date when the report requires one, uploads it to cloud storage, and returns a presigned URL. If no as-of date is selected, Lana uses the latest completed data-pipeline EOD date.

Admin Panel Walkthrough: Regulatory Reports

Step 1. Run end-of-day with the data-pipeline phase enabled.

Step 2. Open regulatory reporting and confirm the latest data refresh date is present.

Step 3. Download the desired report format from Available Reports.

Verification checklist:

  • the latest data refresh date matches the latest completed EOD with a completed data-pipeline phase,
  • as-of report downloads can use the latest EOD date or an older selected date,
  • download buttons are disabled until a completed report data refresh exists,
  • report files can be downloaded from Available Reports after data refresh succeeds.