Purged transactions
For organisations that purge historical transactions from the source UniVerse database, the purged transactions feature keeps those transactions available to HaaS. Purged transactions are loaded into MongoDB-compatible storage, and HCU returns them in List Banking Transactions after the transactions still held in UniVerse.
The feature is a separate HCU service that Biza turns on for your HaaS Space on request. It serves the same adapter API as the standard HCU adapter, and works the same way for every endpoint except List Banking Transactions.
How it works
What is stored
The service uses four collections in one database:
| Collection | Holds |
|---|---|
| Transactions | One document per purged transaction: account ID, transaction ID, transaction code (amountType), amount, effective, processing and receipt dates, description, reference, BPAY, card, direct deposit and NPP details, and the ingest batch ID |
| Account metadata | Per account: the highest ingested transaction ID and the batch it came from |
| Batch metadata | Per ingest batch: status (SUCCESS or FAILED), total transactions, ingests and ingest failures |
| Accounts | Required by the configuration. HCU 13.2.4 doesn't read or write it. |
Each transaction document is keyed by account ID, transaction ID and effective date, so loading the same transaction twice does not create a duplicate. Amounts are stored as non-negative numbers; whether a transaction is a debit or a credit comes from the transaction type mapping for its code.
Ingesting purged transactions
Purged transactions are loaded from a tab-separated file through the service's ingest API. The file must have a header row, and its rows must be grouped by account ID. Each row needs the columns accountid, id, parentid, tranSequence, amount, amountType, description, reference, effectiveDate, processingDate, receiptDate, receiptTime, billerCode, billerName, crn, merchantCategoryCode, BSB, NPPendToEndId, NPPpayer, NPPpayee and NPPextendedDescriptionAscii. Dates use ISO format. Every ingested transaction is stored with status POSTED.
| Endpoint | Purpose |
|---|---|
POST /ingest/transactions | Parse the file at filePath and load it as batch batchId. dryRun defaults to true, which only checks the transactions without storing them. chunkSize (default 50000) sets how many transactions are written at a time. |
PUT /ingest/batch/{batchId} | Record the batch outcome (SUCCESS or FAILED) for the accounts in the file at filePath. On SUCCESS, each account's metadata is set to its highest ingested transaction. On FAILED, the batch's transactions are deleted and each account's metadata is set to its highest transaction outside the batch, or removed if there is none. If a later batch already exists, the request is rejected and account metadata is not changed. |
POST /ingest/reports | Compare a file with what was stored for a batch, per account, as a summarised or detailed report. |
The ingest API sits on the same port as the adapter API and needs the same OAuth bearer token as every other non-health endpoint.
While ingesting, the service:
- Joins narration lines (transaction code
40with a parent ID) onto their parent transaction's description and reference, then drops the narration lines. - Fills card transaction merchant details from the description when the code maps to a card transaction type.
- Checks that each transaction can be turned into an adapter transaction (known code, amount, valid status and dates, and the details its type needs). Transactions that fail are logged and counted, not stored.
- Writes the remaining transactions in chunks. By default each chunk is written in a single database transaction, so a failing chunk is not stored at all and is counted as an ingest failure.
The ingest API returns counts of total, enrichable, unenrichable, ingested and failed transactions.
Serving transactions
When HaaS calls List Banking Transactions, the service:
- Reads the live transactions for the account from UniVerse.
- Queries the purged store for the same account and filters. Date filters compare the effective date. If the account has no metadata yet (no batch marked
SUCCESSfor it), only transactions with no batch ID are used. Otherwise, transactions with no batch ID and transactions from batches up to the batch recorded in the account metadata are used. - Fills each page with UniVerse transactions first, then purged transactions.
totalRecordsandtotalPagescount both sources. - Converts purged transactions to adapter transactions. Transactions with no batch ID get the prefix
purged_on their ID.
Configuration
To turn the feature on, Biza needs:
- The connection string, password and database name of your MongoDB-compatible store.
- The names of the four collections.
By default, each chunk of an ingest is written in a single database transaction. Biza can turn this off if your store doesn't support transactions.
Limitations
- Purged transactions are always returned after all UniVerse transactions, whatever their dates.
- A purged transaction that can no longer be converted when it is served is dropped after paging, so
totalRecordsandtotalPagescan be higher than the transactions actually returned. - Date filters on purged transactions compare dates only, not times.
- The ingest file is read from a path on the service's own file system, and its rows must be grouped by account ID.
Related
- List Banking Transactions mapping
- Mapping files (transaction type mapping)
- Features